How to Create Unique Coupon Codes for Shopify

read
Last updated at:

Overview

In this article, we run through how to create one-time use coupon codes for Shopify stores so that each customer receives their own unique coupon code. This feature provides an alternative to creating a generic coupon code for a given promotion, which means you don't have to worry about codes being shared.

Shopify enforces a limit of 20,000,000 unique discount codes for each Shopify store. If you reach this limit of 20 million codes, you will need to delete unique codes from your Shopify Admin before Klaviyo can resume generating new unique codes.

When to Use Unique Coupon Codes

These are examples of using unique coupon codes in campaigns: 

  • Discount codes for email subscribers: Reward your subscribers by running an exclusive, email-only promotion using coupon codes.
  • Pre-sale discounts for VIP customers: Send your VIPs unique codes that they can use to purchase from a brand-new collection.
  • Shipping delay discount: If some items are back-ordered or you're experiencing delays in order fulfillment, send impacted customers a unique code to thank them for their patience.

These are examples of using unique coupon codes in flows:

  • Abandoned cart: Send a discount code to cart abandoners that haven't bought before — a code that is only active for two to four days will create a sense of urgency and help convert casual browsers into paying customers
  • Winback: Send a discount to buyers who haven't come back recently, incentivizing them to purchase again
  • Welcome series: Give new subscribers a discount code as soon as they join your email list — you can even increase the savings available through the code if they haven't bought after two weeks

Before Getting Started

You will want to make sure that you’re integrated with Shopify and can see the coupon tab in your Klaviyo dashboard. If you haven’t given Klaviyo proper permissions to create Shopify coupons, go to the integrations tab and update your integration. Then, wait for the page to reload before moving back to the coupons tab. Keep reading for the steps to actually creating a coupon. 

Create Your Coupon Code in Klaviyo

First, navigate to the Coupons tab in your Klaviyo account and click Create Shopify Coupon in the upper right-hand corner.

If you haven't given Klaviyo the proper permissions to create Shopify coupons for your account, you may need to click a button and update your integration settings. When you click to update your integration settings, we will re-authenticate with Shopify and then you will be brought back into Klaviyo. If you click to update, and then click the back button or navigate elsewhere before this authentication process completes, this will cause your integration to be disabled.

The_Coupons_tab_in_Klaviyo_when_you_have_a_Shopify_integration._This_tab_shows_the_coupon_name__when_it_was_created_and_last_updated__and_the_number_of_available_coupon_codes.jpg

For each coupon, you can set the following properties in Klaviyo:

  • Name
    This is how the coupon will be identified in Klaviyo.
  • Prefix
    Klaviyo will generate a random code for each person, but you can also specify a prefix that will go before every code (e.g., WELCOME).
  • Discount Type
    Choose whether the coupon is a fixed amount off, a percentage, or free shipping.
    • Free Shipping
      For free shipping coupons, you can limit the coupon so it only applies to certain shipping rates, or only when shoppers are shipping to specific countries.
    • Fixed Amount & Percentage Off
      For coupons where you're offering a fixed amount or percentage off an order, you can specify that the coupon only applies to certain products or collections.
  • Discount Applies to
    Pick whether customers can apply the coupon to the entire order, specific products, or specific collections.
  • Required minimum purchase
    Choose if the coupon can only be used if the customer reaches a specific dollar amount for their purchase. 
  • Minimum Order Subtotal
    Choose whether the coupon is limited to orders meeting a certain subtotal (e.g., 20% off orders over $50). Note that how this works varies based on what you chose for Discount Applies to; e.g., if you select specific products or collections, then the subtotal would be specific to those products or collections. 
  • Activation Date
    This is the date the discount offer becomes active — you can choose to pick a start date, or alternatively select an option where generated coupon codes will become active as they are sent out. Please note that dates are set in the UTC time zone, so you may see a different activation date in Shopify.
  • Expiration
    Choose when you would like your coupon to expire. There are different options for coupons used in campaign messages versus flow messages. Please note that, in Klaviyo, dates are set in the UTC time zone; however, Shopify sets the expiration date/time based on the timezone the store is set to in Shopify, so you may see a different expiration dates in Klaviyo and Shopify for the same coupon.
    • Campaigns
      You have two choices for expiration:
      1. Generated coupon codes will never expire
      2. If you want your discount to have a defined end date, after which generated codes will expire, you can select a firm expiration date
    • Flows
      You have three choices for expiration:
      1. Generated coupon codes will never expire
      2. Generated coupon codes will expire after a certain number of days/hours
      3. If you want your discount to have a defined end date, after which generated codes will expire, you can select a firm expiration date
      Coupons that expire after a certain number of days/hours have variable expiration dates. Although you can create coupons with variable expiration dates for flows, you cannot create coupons with variable expiration dates for campaigns.

Use Your Coupon in a Flow Email

Unique coupon codes for live flow emails are generated automatically in batches of 100. When coupon codes are depleted below 100, Klaviyo will generate another 100 coupon codes. This ensures that there are always enough codes available for live sending flow emails. Because coupon codes for flows are replenished automatically, you won't need to manually add batches of coupon codes via the Add Codes option.  

If your flow is connected to a list that you intend on adding a large number of contacts to, we suggest that you take a different approach and follow instructions for sending a coupon code in a campaign instead. You will need to add as many codes as the number of contacts that you will upload to this list. For example, if you're going to upload 10,000 people to a list, be sure to create 10,000 coupon codes in advance. This is especially important for large list uploads to ensure that your emails send out in a timely manner.

Once a coupon is created, you can insert it into a flow email using the following dynamic placeholder variable:

{% coupon_code 'NAME_OF_YOUR_COUPON' %}

where you replace NAME_OF_YOUR_COUPON with the coupon name (must be an exact match of the name -- capitalization matters). For example:

Example_of_a_welcome_flow_email_with_a_10__coupon_and_showing_images_of_products.jpg

When emails are sent out, this variable will be dynamically replaced with a unique discount code for each recipient. If you use the same coupon tag within multiple flow messages, the recipient will receive the same unique code each time until the code expires. 

When you preview the email directly in Klaviyo, you will not see a unique coupon code populate. Additionally, you will not be able to preview coupon codes with variable expiration dates because you are not able to manually add codes to these types of coupons.

You are manually able to add codes to coupons without variable expiration dates. For emails that include coupons without variable expiration dates, you may generate a live code if you send a preview email to yourself or a member of your team. If you wish to do this, it's important to ensure that you have sufficient codes in your account. Otherwise, you will not see a unique code in your preview and you will need to add codes before being able to send a preview with a live coupon code.

Any flow that contains a coupon that does not expire will send the same code to a customer each time they enter the flow path. If you expect a customer to navigate through a flow multiple times, you may want to consider using a coupon that expires so that each time they enter the flow, they receive a new code.

If multiple people are included in the preview send, they will all receive the same code. As such, if multiple previews are sent within the same minute, these previews will all contain the same code.

Use Your Coupon in an Email Campaign

While Klaviyo generates coupon codes for flow emails automatically, you must manually generate coupons for campaign emails. Once you create the parameters for your coupon, you'll need to specify the number of coupon codes that you want to generate. This must be done before you schedule your campaign. When doing this, key things to keep in mind are:

  • You must generate at least as many codes as expected recipients. This means that if you generate fewer codes than the number of estimated recipients, you will not be able to send or schedule the campaign.
  • If your scheduled campaign is set to "Determine recipients at send time," and the actual number of recipients is greater than the number of codes you generate at send time, the extra recipients will be skipped and will not receive the email.
  • If you generate a large number of codes, be sure to allow time between your campaign's desired send time and when you create the codes. Generating a large number of coupon codes may take up to several hours. Because of this, use the estimated number of recipients of the campaign as a framework and do not significantly overestimate the number of codes you need.

You can generate coupon codes for a particular coupon by clicking the dropdown menu and selecting Add Codes.

The_dropdown_menu_for_the_coupon_is_located_on_the_far_right_side._Click_the_dropdown_menu_to_add_codes__view_the_coupon_s_history__or_delete_the_coupon.jpg

Once you select Add Codes, you will be prompted to input the number of codes you would like to generate. Again, be sure to generate at least as many codes as you have expected recipients for your campaign, otherwise, you will not be able to send or schedule it.

Coupons with variable expiration dates cannot be used in campaigns. As such, you will not see the option to add codes if you have selected a variable expiration date for your coupon.

The "Estimated time to create" area will give you an idea of how long it will take to generate the number of codes you've specified.

Add_Codes_modal__where_you_can_specify_how_many_more_codes_to_add_to_a_coupon.png

Once you click Submit, Klaviyo will begin generating coupon codes for your campaign. A progress bar will appear beneath the coupon name to display progress. You can also track the number of codes that have been created in the Available/Total column.

After the codes have been generated, you can include the coupon tag in your campaign template.

{% coupon_code 'NAME_OF_YOUR_COUPON' %}

Be sure to replace NAME_OF_YOUR_COUPON with the coupon name (must be an exact match of the name — capitalization matters). For example:

Example_of_a_campaign_thanking_customer_for_their_loyalty_with_a_15__coupon.jpg

When emails are sent out, this variable will be dynamically replaced with a unique discount code for each recipient. When you preview the email directly in Klaviyo, you will not see a unique coupon code populate.

However, if you send a preview email to yourself or a member of your team, a live code will be generated. For this reason, it's important to ensure that you have sufficient codes in your account. Otherwise, you will not see a unique code and you will need to add codes before being able to send a preview with a live coupon code.

If multiple people are included in the preview send, they will all receive the same code. Additionally, if multiple previews are sent within the same minute, these previews will all contain the same code.

Once you're ready to send or schedule your campaign, navigate to the final page of the campaign scheduling wizard by clicking Review & Send Campaign. Here, you will see a Coupon Codes area. If you have fewer coupon codes available than expected recipients, you will not be able to schedule or send your campaign and will need to add more codes.

When you schedule or send your campaign, each recipient will receive a unique coupon code. You can see which code an individual recipient received by navigating to their profile and scrolling to the Coupons section as outlined in the FAQs.

Unique Coupons for SMS

Unique coupons are also available for your SMS/MMS messages. Generate the codes just like you would for email. Then, use the template tag below to add the coupon code to your SMS or MMS message:

{% coupon_code 'CouponName' %}.

In the snippet, change CouponName to the name of the coupon you want and add it into the message (either flow or campaign).

Example_of_an_SMS_with_a_20__off_coupon.jpg

Unlike in emails, you can only use one coupon code per SMS message. With email, you have access to hidden blocks to send different coupons based on where someone lives or what they’ve done. If you try to add multiple coupons to an SMS message, you will see an error message.

Best Practices

If you use unique coupons in campaigns and flow emails, there are a few best practices you should stick to:

  • Don't use the same coupon for flows and campaigns. Because you need to specify the number of codes to be generated for campaigns, but not flows, it's a best practice to use different coupons for flows vs. campaigns.
  • Create a separate coupon for each campaign. This way, it will be easier to specify the number of codes you will need for each campaign and you don't risk running out of codes, which would result in some recipients being skipped.
  • Create a separate coupon when changing the categories or products applicable for the coupon. We will by default try to assign all pre-existing codes, so customers may receive and be able to use codes with outdated rules.

Additional Resources

x
Was this article helpful?
1932 out of 2611 found this helpful