Set up Personalization
EdgeKit sets up Personalization for your organization. You tell EdgeKit how your events and profile fields map onto it and which scenarios you need. EdgeKit creates the database and the scenarios, writes the configuration and deploys it.
Before you start
Section titled “Before you start”- Your CMS content syncs to EdgeKit. The catalog is built from your content items, so a site with no synced content has nothing to recommend. See Content sources and Arc XP.
- Your pages run EdgeKit’s tracker, and set its user id to the EdgeKit user id when a user signs in. Call
setUserIdon the tracker fromcreateTrackerwith the user’s EdgeKit user id. Recommendations, profile fields and erasure all name the user by that id, so events under any other id land on a different user in your Personalization database. - Your events carry the article id. An event that says a user viewed an article must carry that article’s id from your CMS in a top-level field of its own data, the same value Content › Content › Items shows as CMS id.
1. Have EdgeKit set up your database
Section titled “1. Have EdgeKit set up your database”Ask EdgeKit to create your organization’s Personalization database, and say which region it should be in. Use one database for your whole organization: EdgeKit separates your sites inside it.
There is no console screen for this. Personalization is on once EdgeKit has set up your database: EdgeKit starts
writing to it, and both recommendation paths answer. Until then, both answer 503 service_unavailable,
Recommendations are not configured.
EdgeKit then syncs your content again, so every published item reaches your Personalization catalog. From then on, each item is sent when it syncs.
2. Tell EdgeKit how to read your events
Section titled “2. Tell EdgeKit how to read your events”Tell EdgeKit:
- Which of your event schemas count as which interaction, and which top-level field holds the article id. For
example:
com.example/article_view/1is a detail view with the article id inarticle_id. An event schema can be a detail view, a view portion, a bookmark, a rating, a purchase or a cart addition. See The event map. Unless the article’s content source has the source keyarcxp, also give that source key, as Content › Configuration › Sources lists it, for examplenews. See Item ids. - Which of your event schemas fires when a user signs in. EdgeKit merges the device into the user on that event.
It must carry both the device id and the user id, so track it after
setUserId. - Which profile fields to send as user properties. Only your own profile fields can be sent. See Users.
- Which site’s profile to send. One site only.
EdgeKit writes this as your organization’s Personalization configuration, adds it to your draft and deploys it. It takes effect from that deploy. Staging refuses a draft whose Personalization configuration is invalid, or names a profile site the deployment does not carry. See Stage and deploy a change.
Ask EdgeKit to change the configuration later, for example when you add an event schema or a profile field.
3. Tell EdgeKit which scenarios you need
Section titled “3. Tell EdgeKit which scenarios you need”Tell EdgeKit each place your pages or newsletters show recommendations and what each should show, such as
read-next under an article and for-you on a home page. EdgeKit creates and tunes a scenario for each, with its
logic, filters and boosters, and gives you its name. Ask EdgeKit to change a scenario at any time.
A request that names a scenario your database does not have answers 422 unprocessable_entity, Unknown scenario.
4. Keep recomm_id out of your cache key
Section titled “4. Keep recomm_id out of your cache key”Every link EdgeKit returns carries ?recomm_id=<id>, and each answer has its own id. Set your CDN to ignore
recomm_id in its cache key, or every recommended click misses your cache. Keep the parameter in the URL the page
loads: EdgeKit reads it from the page URL of the events the page sends, and that is how a click is attributed to its
recommendation.
5. Call the recommendation paths
Section titled “5. Call the recommendation paths”- From your pages: call
/edgekit/v1/recommendationson your own domain. Your domain must route/edgekit/to EdgeKit. A call from any other origin must come from one of the site’s allowed origins. See Mount /edgekit/ on your domain. - From your server: issue an API key pinned to the site, and call
/v1/recommendationswith it. See Issue and revoke API keys.
See Get recommendations for both requests.
6. Personalised newsletters
Section titled “6. Personalised newsletters”A personalised feed in a newsletter picks each recipient’s items from Personalization when the edition is sent.
In Messaging › Email & Push Editions › Feeds, a feed of type Personalised takes a scenario, picked from your database’s scenarios. With No scenario, every recipient gets the same items from the feed’s filters. The Personalised type cannot be chosen until EdgeKit has set up your database.
When Braze renders a recipient’s message, it calls GET /v1/recommendations with the recipient’s user id, the
feed’s scenario and the feed’s filters. Store an API key pinned to the newsletter’s site in Braze as a Connected
Content credential named edgekit. EdgeKit never puts the key in the URL. If the call fails after Braze’s retries,
Braze does not send that recipient’s message. An empty answer leaves the slot out, and the message still goes.
Before you send personalised editions:
- Tell EdgeKit before your first personalised edition, so your database is ready for the volume. Every recipient costs at least one recommendation call, so an edition to a million recipients is at least a million calls, sent as fast as Braze sends.
- Ask EdgeKit to turn on already-read filtering for your database before a feed uses Remove what the user
already read, which sends
excludeAlreadyRead=true. Until then, every such request fails, and with it the send.