Integrate Zapp Unique Coupon Upload

  • Updated
The terms audiences and segments are interchangeable. Optimizely has updated all segments to audiences in the Audiences page and is currently working on updating the UI in other pages. See Understand audiences to get information on audiences. 

This integration lets you import your pre-generated coupon codes into Optimizely Data Platform (ODP) to use in your campaigns. You can use different coupon codes for various campaigns and audiences. You can assign a unique code based on a customer attribute, including assigning coupon codes exclusively to repeat customers.

Integrating Unique Coupon Upload gives you the following values and benefits:

  • Track which coupon codes were assigned to your customers.
  • Re-use the same coupon code in reminder or follow-up touchpoints.
  • Give your Support Team insights into which coupon codes were given to customers.

This document was updated on 11/23/2020 to reflect recent changes to the app that affect coupon code configuration. If you set up a campaign using coupon codes prior to this date, update your campaign with the new method.

Requirements

  • Generate your coupon codes in your ecommerce platform and load them into a Google Sheet before importing them into ODP. 
  • Store the coupon files in Google Sheets and give access to the Google user who authenticates in ODP.
  • Check that the Google Sheet was edited in the past 30 days.
  • Format the coupon files with a single column and no header row.
  • Include "zaius_coupons" in the names of the coupon files and use unique names that have never previously been imported.
  • Use codes that were not previously imported to ODP.

Configure Zapp Unique Coupon Upload

  1. Go to Data Setup > App Directory > Unique Coupon Upload > Install App.
  2. Go to Settings > Authorize to give ODP access to the required Google Sheets APIs. You should designate a single Google user for this purpose. Make sure the coupon sheets are shared with this designated user so as to prevent new ODP users from having to re-authenticate to access new sheets.
  3. If prompted by Google, confirm your target ODP account.
  4. You should now see Get Google Sheet in your settings.

Import coupons

  1. Go to Get Google Sheet and select the Google Sheet containing your first batch of coupon codes.

  2. Enter the Coupon Rule ID (rule_id) for the coupons in the list. If you specify an existing rule_id, you will be adding these coupons to the "pool" of available coupons for that rule_id. If you specify a new rule_id, you will create a new "pool". You will use the rule_id you enter here when you are adding Liquid to your messages to request a coupon code in your campaigns. The rule_id must be lowercase, alphanumeric with underscores.
  3. Click Store Coupons to begin the import.

Manage your coupon rules

Click Manage Coupon Rules to view all the coupon rules you generated in ODP. When you click the drop-down list, ODP dynamically assesses which rules you have and how many codes remain in each pool and displays each valid "rule_id" available for use in liquid.

Selecting a rule and clicking Purge Rule removes all remaining (undistributed) codes from that pool.

Use coupons in a campaign

Complete the following steps to render a unique coupon code in an email:

  1. Add a variable name for your coupons to your copy, for example, {{coupon_code}}. Remember to request the correct rule_id in the code (Optimizely uses “example_code” in its code snippets).
  2. Drag-and-drop a Raw HTML element to the top of your email and copy the following Liquid code into the container:
    {% assign coupon_code = app.unique_coupons.generate_coupon(rule_id: 'example_code', email: customer.email) %}

You should add a "utms" parameter. For emails, you can supply the auto-utms of the campaign by sending the utm_params value. See the following example:

{% assign coupon_code = app.unique_coupons.generate_coupon(rule_id: 'example_code', email: customer.email, utms: utm_params) %}

Remember the number of coupon codes you imported and the number of campaigns in which you use coupon codes. If the number of sends in your campaign exceeds the number of unassigned coupon codes, ODP will stop sending after the campaign has used all available unassigned coupon codes. You can keep track of the number of unassigned codes remaining for a specific rule in the Settings of the Unique Coupon Upload app. If you need more coupon codes to complete a campaign, you can upload a Google sheet with new codes under the same rule_id.

Limitations in email

You cannot include a coupon code in the subject line and preheader of your email.

Non-email channels

If a channel uses an identifier other than email address, you must use that channel's identifier for generating coupons. Optimizely added shortcuts for both email and phone.

You can specify these or any other customer identifier manually. Include UTM parameters, however, non-email channels do not typically have automatic parameters available and need the parameters specified manually.

To use an SMS example, use the identifier phone:

{{ app.unique_coupons.generate_coupon(
  rule_id: 'example_code',
  identifier_field: 'phone',
  identifier_value: customer.phone,
  utms: '?utm_source=zaius&utm_medium=sms&utm_campaign=springblast&utm_content=discount')
}}

Alternately, use the shortcut available for phone as well as email:

{{ app.unique_coupons.generate_coupon(
  rule_id: 'example_code',
  phone: customer.phone,
  utms: '?utm_source=zaius&utm_medium=sms&utm_campaign=springblast&utm_content=discount')
}}

Campaigns with coupon codes prior to 11/23/2020

The setup for campaigns containing coupon codes changed as of 11/23. Update your campaigns based on the following steps to ensure that they function correctly:

  1. Update the code in your static variable:
    {% assign coupon_code = app.unique_coupons.generate_coupon(rule_id: 'example code', email: customer.email) %}
    Update the placeholders for "coupon_code" and "example code" with your own names for the static variable and the rule_id.
  2. Copy the resulting code.
  3. Drag-and-drop a Raw HTML block to the top of your email.
  4. Paste the code from the static variable into the Raw HTML block.
  5. Return to the bottom of your email and delete the static variable, by clicking on the X icon.