Campaign Webhook Loyalty Points Assignment via Braze
Contents
- 1 Overview
- 2 Braze Webhook Campaign Setup
- 2.1 1. Login to Braze
- 2.2 2. Navigate to Campaigns
- 2.3 3. Create a new Webhook Campaign
- 2.4 4. Configure the Campaign Details
- 2.5 5. Compose the Webhook
- 2.5.1 Webhook URL
- 2.5.2 HTTP method
- 2.5.3 Request Body
- 2.5.4 Request headers
- 2.5.4.1 Content-type
- 2.5.4.2 X-Region
- 2.5.4.3 X-Api-Key
- 2.6 6. Test the loyalty points are getting assigned to your user
Overview
This guide will show you how you can create a Webhook campaign in Braze to assign loyalty points to only specific users. This means only these particular users will be awarded or deducted these loyalty points. 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 users that meet a specific criteria set in Braze (e.g. assign 200 loyalty points to guests that just completed an order). These loyalty points will expire according to the points expiration rules set in Sanity.
Braze Webhook Campaign Setup
1. Login to Braze
Login to your braze account
2. Navigate to Campaigns
In the homepage, click on “Campaigns”
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/assign-points
Example of the Cold Webhook URL in Production:
https://euc1-prod-bk-loyalty-middleware.rbictg.com/bulk-action/cold/assign-points
the Hot path should be used for any user 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 Marketuse2
Latin America Timezone Markets
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/assign-points
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.
{
"pointsEarned": 500,
"source": "braze",
"email": "{{${email_address}}}"
}
pointsEarned
→ replacepointsEarned
with the amount of points you would like users that receive this Braze webhook to receive. This can be a positive number to assign points or a negative number to deduct points from the user.source
→ should bebraze
in Production;braze-test
in lower environments (Dev, Staging)email
→ leave as is
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 loyalty points are getting assigned to your user
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 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 users. For more information refer to: Campaigns