Contents
Overview
This guide will show you how you can create a Webhook campaign in Braze to assign offers to only specific guests. This means only these particular guests will see these offers. In order to do this you will need to create a config Offer in Sanity and then create a Braze webhook campaign to assign this offer to guests that meet a specific criteria set in Braze (e.g. assign Veggie Whopper Offer to guests that replied to a survey that they are vegetarian).
Sanity Setup
1. Create a personalized (or config) Offer
Follow this guide to create the offer: Offers - Configuration Guide
Note: You will need a different Config Offer created for each offer you would like to assign using Braze.
2. Save the Loyalty Engine ID
of the config offer to input into Braze after
3. Add the config (personalized) offer to Live Config Offers
To access Live Config Offers navigate to Order-Level Content > Loyalty > Live Offers Configuration > Live Offers > Live Config Offers in Sanity.
The offer will only show in the guest app if it is assigned to the guest and added in this section in Sanity.
Note: If the same offer is assigned multiple times, the guest will see the same offer added multiple times to their offer list. This means that the guest will see multiple instances of the same offer in their offer list - as many as offer assignments done for that offer. Each offer will maintain their own configuration settings
Braze Webhook Campaign Setup
1. Login to Braze
Login to your braze account
2. Navigate to Campaigns
In the homepage, click on “Campaigns”
“Campaign” assignment works well for if you are aiming to do a one-shot offer assignment. Instead, if you are aiming to perform one of the below tasks, you should use “Canvas” instead:
Assign several offers to the same segment
A/B tests different offers
Segment and assign offers according to guest behavior
or if you have different segments you are planning to assign the offers to
More details here: https://rbictg.atlassian.net/wiki/spaces/IC1/pages/edit-v2/5157814281
3. Create a new Webhook Campaign
Click on “Create Campaign”. Then click on “Webhook”.
4. Configure the Campaign Details
Add the name of the campaign in the “Campaign Name” field
Click on “Blank Template”
5. Compose the Webhook
Webhook URL
Example of Hot Webhook URL in Production:
https://euc1-prod-bk-loyalty-middleware.rbictg.com/bulk-action/hot/create-offer
Example of the Cold Webhook URL in Production:
https://euc1-prod-bk-loyalty-middleware.rbictg.com/bulk-action/cold/create-offer
the Hot path should be used for any guest triggered campaigns that should happen in realtime
ie: T-Mobile Tuesdays, sign up bonuses
the Cold path should be used for any marketer triggered campaigns that can be processed over time
ie: mass offers assignments, mass points updates
the Webhook URL should always begin with the following format:
https://{reg}-{env}-{brand}-loyalty-middleware.rbictg.com
Where:
Region
{reg}
variables:euc1
EU Timezone Marketsapse1
APAC Timezone Marketseuw3
Iberia Timezone Market
Environment
{env}
variables:dev
,staging
,qa
orprod
. Please always test withstaging
first.Brand
{brand}
variables:bk
,plk
orfhs
(other brands are not supported in International markets yet).
Please always test offer assignment in staging
environment first. Here is an example of an URL with an offer that needs to be assigned in staging
env for PLK ES using hot
path:
https://euw3-staging-plk-loyalty-middleware.rbictg.com/bulk-action/hot/create-offer
Input the URL in the “Webhook URL” field
HTTP method
Keep this field set to “POST”. No changes needed here.
Request Body
Inside “Request Body” choose “Raw Text”
Then copy the format below and paste it inside the Raw Text field.
{ "email": "{{${email_address}}}", "source": "braze-test", "rank": 123456, "configId": "Loyalty engine id of config offer", "ruleParams": { "startDate": "yyyy-mm-dd", "endDate": "yyyy-mm-dd" } }
configId
→ replaceconfigId
with the Loyalty Engine ID of the config offer you want to assign using Brazesource
→ should bebraze
in Production;braze-test
in lower environments (Dev, Staging)email
→ leave as isstartDate
andendDate
→ theendDate
must be set after thestartDate
- this represents the duration of time the offer will be available for the guest in the guest app
startDate
and endDate
always counts from 00:00 to 23:59 from their respective dates.
rank
→ (optional) field that determines the sequence priority of the assigned personalized offer. The lower the number, the higher the priority (i.e. 1 would rank at the top)
By default, the assigned offers will have the same rules as the ones configured in Sanity. If you want to override some of these with custom rules, for example, a custom End Date & Start Date, you can pass the following arguments:
"ruleParams": { "startDate": "{{ "now" | date:"%F" }}", "endDate": "{{ "now" | date:'%s' | plus:604800| date:"%F" }}" }
In the above example, we set the Start Date to be the time when the Offer was assigned, and we set the End Date to be 7 days after the offer was assigned (now + 604800 seconds).
Request headers
Scroll down to request headers section and click “Add New Header” 3 times
Then input the below headers keys and their values (
Content-type
,x-region
, andx-api-key
)
Content-type
Content-Type: application/json
X-Region
x-region: gb
x-region
is the 2-character ISO country code string of that market (e.g. gb
= United Kingdom, ch
= Switzerland)
X-Api-Key
x-api-key: string
Please reach out to your market setup representative to get you access to the API Key in Production or Staging for your brand
6. Test the offer is getting assigned to your guest
It is extremely important to test your offer webhook, before launching the campaign. Once an offer is assigned to a guest its configuration and rules CANNOT be changed using Sanity.
In the “Compose” section in Sanity click on “Test”. Then choose “Select existing user” from the dropdown “Preview message as user”. After this input the email address of your test user in the guest app. Last but not least, click on “Send Test”. Now the offer should show on the top of your offer list.
Note: The rest of the Braze campaign needs to be configured like any other Braze campaign (e.g. email, IAM, or push campaign). You will need to input specific information on the Schedule Delivery of the campaign, the Target users the campaign will apply to and when the campaign should be delivered to these target guests. For more information refer to: https://www.braze.com/docs/user_guide/engagement_tools/campaigns