/
Campaign Webhook Loyalty Points Assignment via Braze

Campaign Webhook Loyalty Points Assignment via Braze

Contents

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

image-20240807-104356.png

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 Markets

    • apse1 APAC Timezone Markets

    • euw3 Iberia Timezone Market

    • use2 Latin America Timezone Markets

  • Environment {env} variables: dev, staging, qa or prod . Please always test with staging first.

  • Brand {brand} variables: bk, plk or fhs (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}}}" }
  • pointsEarnedreplace pointsEarned 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 be braze 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, and x-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

Related content