Braze
EdgeKit works with your organization’s own Braze workspace in four ways:
- it forwards your events to Braze as custom events, see Forwarding;
- it writes the profile fields you choose to each user’s Braze profile, see User attributes;
- it keeps Braze subscription groups in step with each user’s standing on your lists, see Newsletters;
- it sends your publication editions through Braze, by email and push, see Email & Push Editions.
Braze is one of two messaging providers lists and publications send through, beside SendGrid. One workspace serves all your sites.
What you set up in Braze
Section titled “What you set up in Braze”Once for your workspace
Section titled “Once for your workspace”-
A REST API key and your REST endpoint. Save both in Delivery › Configuration › ESP, Braze tab, the endpoint like
https://rest.iad-01.braze.com. EdgeKit lists one page of campaigns with them first: a key Braze answers401to is not saved. Any other answer,403or no answer included, saves both and replaces what was there, with a warning that Braze did not confirm them. Saving them also turns on custom events: your events that carry a user id start going to Braze. Braze cannot change a key’s permissions after you create it, so create it with all of these:Permission What EdgeKit uses it for users.trackCustom events, user attributes, the global email opt-in, unsubscribe links users.deleteDeleting an erased user’s profile, with a profile key or attributes set subscription.status.setEach user’s list standing subscription.status.get,subscription.groups.getNothing yet. Asked for now so the key never needs replacing messages.send,sends.id.createEdition sends and test sends campaigns.details,segments.detailsChecking the Braze ids you save campaigns.list,segments.listThe campaign and segment pickers A key without
campaigns.detailsorsegments.detailsmakes every save that names a Braze id fail with “Braze answered 403”. -
An email channel. Find your app identifier in Braze under Settings › APIs and Identifiers. In Messaging › Configuration › Channels, add a channel of type Email and enter it as the Braze app ID. Braze needs one on every email. EdgeKit cannot check it: a wrong one shows up as a failed test send.
-
A push channel, if you send push. Add a channel of type Push. It needs no app identifier: Braze pushes to every app a user has. Its optional App link pattern opens a push in your app instead of the web page.
-
Two webhook campaigns, so an unsubscribe made in Braze reaches EdgeKit. Choose a webhook secret of at least 16 characters and save it under Subscription webhook secret on the Braze tab of Delivery › Configuration › ESP. Both campaigns send that same value. Until it is saved, EdgeKit answers every webhook
503. See Subscription webhooks. -
A Connected Content credential, only if a publication uses a personalised feed. See Personalised feeds.
Once for each list
Section titled “Once for each list”Create a Braze subscription group for the list, and paste its id as the list’s Vendor group id in
Messaging › Configuration › Lists. One group backs one list. EdgeKit cannot check the id.
Once for each publication
Section titled “Once for each publication”Braze has no API that creates a campaign or a segment, so you create these in Braze by hand:
- One API campaign. Add one message per variant and channel: an email message, and an iOS push and an Android push message for each platform you have an app on. Every send of the publication counts under this campaign, and each variant under its own message. Do not archive the campaign: EdgeKit refuses an archived one.
- One segment per variant, filtered on the list’s subscription group and on a Random Bucket # range that is the variant’s share. Variant segments must not overlap: a user in two of them gets the edition twice. EdgeKit cannot check this. A push segment targets the apps instead of the subscription group.
Then add each segment in Messaging › Configuration › Segments, picked from your workspace’s live list, and pick the campaign, the segments and each variant’s message ids on the publication’s ESP Configuration tab.
EdgeKit checks every Braze id it is given before it saves. The campaign must exist and not be archived, each message must belong to that campaign on the right channel, and each segment must exist. If Braze does not answer, the save is refused with “Braze did not answer, so the Braze ids could not be checked”, never saved unchecked.
A test send goes to the users in a test group from Messaging › Configuration › Test groups, by their Braze
profile’s external_id. Each tester needs a Braze profile under that id: see How profiles are keyed.
How profiles are keyed
Section titled “How profiles are keyed”EdgeKit names every Braze profile by its external_id. Your tenant’s setting decides what that is:
| Setting | A user’s external_id |
|---|---|
| EdgeKit user id | The EdgeKit user id. This is the default. |
| External identity | The id your own identity provider gives the user, as EdgeKit holds it |
Set it under Profile key on the Braze tab of Delivery › Configuration › ESP; it applies on your next deploy. Choose External identity when your Braze workspace already keys its profiles by your own user id.
Set your tracker’s user id to the same value when a user signs in, and key your own Braze profiles the same way. Events under any other id land on a different Braze profile from the user’s list standing.
Under External identity:
- EdgeKit writes nothing to Braze for a user it holds no external identity for. A user who joins a list before your identity provider has named them reaches Braze the next time their subscriptions change after that.
- A test send leaves out a tester with no external identity.
- Newsletter links carry nothing: they need the EdgeKit user id in the link.
- Changing the setting later moves no profile. Profiles under the old id keep what EdgeKit wrote to them.
EdgeKit writes an email address and custom attributes to a profile only when your tenant pushes user attributes. Until then, putting each user’s email address on their Braze profile is up to you.
Every request EdgeKit sends to Braze carries the header User-Agent: partner-EdgeKit-Platform, so your workspace’s
API usage report shows EdgeKit’s traffic under that name.
Subscription webhooks
Section titled “Subscription webhooks”EdgeKit is the record of who is on which list, and it never reads a user’s list standing back from Braze. When a user unsubscribes inside Braze (Braze’s preference centre, a mail client’s unsubscribe button that reaches Braze, another system’s API call), two webhook campaigns tell EdgeKit. Without them, the next change EdgeKit pushes for that user sets them back to subscribed.
Create both as Webhook campaigns with Action-Based delivery:
| Campaign | Trigger | scope |
subscription_group_id |
|---|---|---|---|
| Group | Update Subscription Group Status, Unsubscribed, on the list’s subscription group | group |
The list’s group id |
| Global | Update Subscription Status, Email, Unsubscribed | global |
Leave out |
The body names one group, so you need one group campaign for each list.
Both send the same request:
- URL:
https://<tenant>.edgekit.ai/v1/webhooks/braze/subscriptions - Method:
POST - Headers:
Authorization: Bearer <webhook secret>, with the secret you saved under Subscription webhook secret on the Braze tab of Delivery › Configuration › ESP, andContent-Type: application/json - Body, for the group campaign:
{ "scope": "group", "state": "unsubscribed", "subscription_group_id": "<the list's group id>", "external_id": "{{${user_id}}}", "email": "{{${email_address}}}", "occurred_at": "{{ 'now' | date: '%Y-%m-%dT%H:%M:%SZ' }}"}The global campaign’s body is the same with "scope": "global" and no subscription_group_id.
Give both campaigns these delivery settings, or unsubscribes are lost: re-eligibility on with the shortest window, no frequency capping and no rate limit, all users with no segment or filter, and excluded from any Global Control Group.
| Request | EdgeKit answers |
|---|---|
| Valid, with the right secret | 200, { "received": true } |
| A body EdgeKit cannot read, with the right secret | 200, so Braze does not resend it. EdgeKit logs it and applies nothing |
| Missing or wrong secret | 401 |
| EdgeKit holds no webhook secret, or cannot queue the change | 503 |
What EdgeKit applies:
- Only unsubscribes. A body with any other
statechanges nothing. - Only if newer. An unsubscribe whose
occurred_atis older than EdgeKit’s last change to that user’s standing is dropped. - Which user:
external_idas the EdgeKit user id, then as the user’s external identity, elseemail. A group unsubscribe from an address EdgeKit does not know creates a user; a global one does not. - Global means every list the user stands on. Group means every list backed by that group.
What EdgeKit writes
Section titled “What EdgeKit writes”| What | When | Braze endpoint |
|---|---|---|
| Custom events | As your events arrive, in batches of up to 50 | /users/track, events only |
| User attributes | Each time a user’s profile is rebuilt, when your tenant pushes user attributes | /users/track, attributes |
| List standing | After a user’s standing on a site’s lists changes, once 10 quiet seconds pass, at most 5 minutes | /v2/subscription/status/set |
| Global email opt-in | When a user who unsubscribed from all email in Braze joins a list again | /users/track, email_subscribe |
| Unsubscribe link | When a user leaves a list through an edition’s link, from a profile EdgeKit does not keep in sync | /users/track, by braze_id |
| Edition sends | At each send time: one send id, then one call per variant and segment, to subscribed users only | /sends/id/create, /messages/send |
| Test sends | When you send a test, to the test group’s users, outside the campaign’s numbers | /messages/send |
| Erasure | When you erase a user in EdgeKit | /v2/subscription/status/set, their groups unsubscribed; /users/delete with a profile key or attributes set |
A list standing push carries the user’s whole state on that site’s deployed lists, never a change, so a late or repeated push ends in the same state. A user awaiting double opt-in confirmation is not pushed: EdgeKit sends the confirmation email itself, not through Braze. A list you disable stops being pushed. If Braze refuses a push for good, or keeps failing, EdgeKit stops retrying and marks the user’s standing on those lists as failed to sync.
Every edition carries EdgeKit’s own unsubscribe link and List-Unsubscribe headers, signed for each recipient inside
Braze. The link carries the profile’s external_id and braze_id, and EdgeKit checks its signature without asking
Braze for anything. There is nothing to set up for them.
A click from a profile EdgeKit has no user for is unsubscribed in Braze only. The subscription webhooks then tell EdgeKit, with the profile’s email address.
EdgeKit checks push payloads against Braze’s caps before an edition can be scheduled: 1,912 bytes on iOS and 4,000 on Android, the app link included.
Custom events
Section titled “Custom events”Custom events go to Braze while your REST key and endpoint are saved, and only for events that carry a user id.
Anonymous events are never sent: Braze’s subject is external_id.
| EdgeKit event | Braze event name | Properties |
|---|---|---|
| A self-describing event | Its schema name, such as link_click |
The event’s own data |
| A structured event | Its se_action, else struct |
se_category, se_action, se_label, se_property, se_value |
| Any other event, such as a page view | Its event type, such as page_view |
None |
timeis when EdgeKit received the event, never the device’s clock.- A property key Braze would refuse is rewritten:
.,$and spaces become_, and keys are cut to 255 characters. Null values are dropped. Nested values are sent as they are. - No entities are sent, and nothing says which site an event came from.
Braze answering 429 or 5xx, or not answering within 30 seconds, makes EdgeKit retry the batch, up to three
times. After a 429, EdgeKit sends that batch again only once the time in Braze’s X-RateLimit-Reset header has
passed. Any other refusal drops the batch for good. Either way the events stay in EdgeKit’s archive: only the Braze
copy is lost. A wrong key answers 401, so every batch is dropped until EdgeKit has the right one.
User attributes
Section titled “User attributes”EdgeKit can write fields of a user’s profile to their Braze profile, so a Braze segment can filter on them and an edition can reach them. It is off until EdgeKit staff set it up for your tenant: tell us which profile fields to send and which site’s profile to send them from. The change takes effect on your next deploy, which rebuilds every profile and so sends every user once.
- Each field is written under its own name, with every character other than a letter, a digit or
_replaced by_. A field namedemail,first_name,last_nameorcountryfills Braze’s own profile field of that name. Braze has no address for a user unless you send theemailfield. - A profile is written whole each time it is rebuilt. A field with no value is sent as
null, which removes that attribute in Braze. - At most 100 fields, from one site’s profile. Access state is never sent, and neither is subscription state: list standing has its own push.
- Anonymous devices have no profile, so nothing is written for them.
- A field you stop sending keeps its last value in Braze.
- Up to 75 users are written in one request. A profile reaches Braze within about 10 seconds of its rebuild, and one request is in flight at a time.
Braze answering 5xx, or not answering within 30 seconds, makes EdgeKit retry. After a 429, EdgeKit retries only
once the time in Braze’s X-RateLimit-Reset header has passed. Any other refusal stops the push for every user in
that request until their profiles are rebuilt again.
When you erase a user, EdgeKit deletes their Braze profile, then deletes it again five minutes later. The second delete removes a profile that a write already on its way to Braze re-created.
Personalised feeds
Section titled “Personalised feeds”A publication slot filled from a personalised feed asks EdgeKit for each recipient’s recommendations through Braze Connected Content, once per recipient, at send time. See Feeds.
- Issue an EdgeKit API key pinned to the publication’s site. See Issue and revoke API keys.
- In Braze, under Settings › Connected Content, add a token credential named exactly
edgekit, with the headerx-api-keyand the API key as its value.
The key never goes in a URL, because Braze logs rendered URLs. Without the credential every call is refused, and Braze aborts each message after its retry.
What EdgeKit reads
Section titled “What EdgeKit reads”- Campaign and segment details, to check the ids you save and on the publication’s ESP Configuration tab.
- Your campaign and segment lists, for the pickers. The campaign picker offers unarchived API campaigns only.