How to use Braze Promotion Codes in Campaigns & Canvas
When I was new to Braze, the hardest thing I tried was to create a solution to give users a personalized discount code. The crux was that it also needed to be saved against their profile, so it could be referenced more than once and in different channels.
This was before User Update and AI so the only solutions were self-composed Liquid or an external service.
In this case, it was no better in the past. It is much easier now than it ever was. "Promotion Codes" is the answer and I will show you how to set everything up correctly.
TL;DR
-
Create a Promotion Code list and upload codes (CSV, one per line).
-
In Campaigns: paste {% promotion('...') %} where the code should appear.
-
In Canvas: save the first code to an attribute (promo_code) and reuse {{custom_attribute.${promo_code}}} in later steps.
-
Upload more codes than you think and set notifications.
Create a promo code list
The first step before you can use codes in Campaigne or Canvas is to create your list of codes. Note that Braze does not create the codes for you. You have to generate them yourself outside Braze and then upload them. If you're not sure how - talk to a developer or tech-savvy coworker. You can certainly generate codes using formulas in Google Sheets or Excel or through a simple script.
Here's how to create a list:
-
Navigate to "Data Settings" > "Promotion Codes "

-
Name & Description: Enter the name and description.
-
Create "Code Snippet": This is unique and how you and Braze will reference the list. It also cannot be changed afterwards so give it a clear name.

-
Expiration & alerts: Define how long your codes should be active (max six months ahead). All codes in the list share the same expiration date. You can also add a way for you or a coworker to receive an email when the list is about to expire or when the date is approaching.

-
Upload codes: CSV, one code per line is what counts. The file must not exceed 100 MB and 20 million codes.
Use in Campaigns
When working in a campaign, insert the codes directly into the message. You can find the code in the list you just created. Press "Copy Snippet" and just paste it into your message.

Braze, 2025
Example:
Here's your personalized code:{% promotion('Jul25') %}
Here's how it works in a bit more detail:
-
When the mailing is prepared, a unique code is retrieved per recipient.
-
If the mailing is sent, the code is used up. If the mailing is canceled, the code is not used.
-
If the list is empty or expired, the campaign is not sent at all. Therefore, best practice is to upload more codes than you think you need.
-
If your communication refers to more than one list (e.g. "if gold customer > gold code, otherwise > standard code"), Braze will reserve a code from both lists in the preparation regardless. This may explain why the consumption of codes does not always match the number of messages sent.
-
In Multi-Channel Campaigns (e.g. email + push), the recipient receives the same code in all channels.
In-app message campaigns
At the time of writing, the use of "Promotion Codes" in IAMs is in early access. If you do not already have it turned on, please contact your account manager at Braze.
Use in Canvases
In Canvas, "Promotion Codes" work a little differently. Each step that contains a promotion tag gives the user a new code. Thus, if users go through multiple steps with the same one, they get multiple different codes, even if it's the same tag e .g. "{% promotion('Jul25') %}"
So in a scenario where you want to give them a code and then, later in the journey, remind them of the same code, you need to set it up a little differently.
Reuse the same code in multiple steps
If you want a user to get the same code throughout the Canvas, you need to save the first code as a custom attribute:
-
Put a User Update step in the step before your first message step with the promotion code.
-
Attribute Name: Promo_Code
-
Action: Update
-
Key Value: {% promotion('Jul25') %}

-
-
In later steps, refer to the attribute instead of the promotion tag:
{{custom_attribute.${Promo_Code}}}
This way, the same code can be reused in several messages during the user's journey. If you want to save a code from a promotion against a user's profile, you can set up a standing canvas with the same set but with the Action Path referencing that promotion.
What channels can you use Promotion Codes in?
"Promotion Codes can be used in:
-
Email
-
Mobile push & web push
-
Content Cards
-
Webhooks
-
SMS
-
WhatsApp
Transactional Email Campaigns and IAM in Canvas do not work (support for IAM in Campaigns is Early Access).
Summary
"Promotion Codes" allows you to personalize your mailings, drive engagement and measure the impact of your campaigns more accurately.
It's also easy: create your list of codes, upload them and cut and paste the list's code into your Campaigns or Canvases. In Canvases, it takes a bit of thought if you don't want users to receive several different codes along the way, but once you've done it once, it's a breeze.