Skip to content

Sending unique discount codes through Shopify

This community-submitted use case shows how to use Braze promotion codes with the Shopify Bulk Discount Code Bot to generate unique discount codes for your campaigns and Canvases. Unique discount codes help avoid the exploitation of generic promotion codes.

Requirements

Generating unique discount codes

Step 1: Configure your discount codes

Use the Bulk Discount Code Bot to configure your discount codes based on the number of codes to generate, code length, discount value, and more.

The configuration options for a discount set.

Step 2: Export your codes

Find your discount set in the Bulk Discount Code Bot’s search bar, then select Export Codes > Download Codes to download a CSV file to your Downloads folder.

Search bar with a dropdown displaying the discount set and a row of buttons to select from.

In the CSV file, delete row 1 to remove the column header “Promo”. This will prevent “Promo” from becoming a discount code in Braze.

A flowchart showing the removal of the row header "Promo" in a CSV file.

Step 3: Add your discount codes to Braze

In Braze, go to Data Settings > Promotion Codes > Create Promotion Code List and configure your discount codes list. Make sure you match the expiration date that was configured by the Bulk Discounts Code Bot.

Then, upload your CSV file and select Save List.

Step 4: Add your discount codes to a Braze campaign or Canvas step

If you want to use your unique discount codes in a single-send campaign, or you don’t mind users receiving multiple unique codes across different campaigns or Canvas steps, copy the code’s Liquid snippet from the promotion codes list you saved.

A Liquid code snipppet with a button copy it.

Paste the Liquid snippet into a campaign or Canvas step.

A GIF showing the Liquid snippet being added to a Canvas step.

If you want users to recieve a single unique discount code no matter how many times the discount code is referenced in campaigns or Canvases, create a User Update step directly before the first Message step that assigns the discount code to a custom attribute, like “Promo Code”.

In the User Update step, do the following for each field:

  • Attribute Name: Select Promo Code.
  • Action: Select Update.
  • Key Value: Paste the Liquid code snippet.

A User Update step that updates a "Promo Code" attribute with the Liquid snippet.

Now, you can add the custom attribute {{custom_attribute.${Promo Code}}} to any message, and the discount code will be templated in.

Discount code behavior

Multichannel campaign or Canvas step

When a discount code snippet is used in a multichannel campaign or Canvas step, users always receive a unique code. If a user is eligible to receive a code through more than one channel, they’ll receive the same code through each channel. In other words, an eligible user would only receive one code across all the messages sent by that campaign or Canvas step.

Different Canvas steps or separate campaigns

When a discount code is referenced by multiple steps in the same Canvas or by separate campaigns, an eligible user will receive multiple unique promotion codes (one code for each Canvas step or campaign).

HOW HELPFUL WAS THIS PAGE?
New Stuff!