Unique Coupon Codes in Klaviyo Flows
How to generate and use unique coupon codes in Klaviyo flows. Setup, expiration strategies, common mistakes, and when to use unique vs static codes.

Mark Cijo
Founder, GOSH Digital
Unique Coupon Codes in Klaviyo Flows
Static coupon codes are a liability. "WELCOME10" gets shared on coupon sites within 48 hours. Then every person who visits your store — including people who would have paid full price — uses a discount you didn't intend for them.
Unique coupon codes solve this problem. Each subscriber gets a one-time-use code that's generated specifically for them. It can't be shared because it only works once. It can expire after a set number of days, creating genuine urgency. And you can track exactly which flow and which email drove the redemption.
Klaviyo has built-in support for unique codes, but most brands either don't know about it or set it up incorrectly. Let me walk you through the right way.
How Klaviyo Generates Unique Codes
Klaviyo connects to your Shopify discount system (or your platform's equivalent) to generate unique coupon codes. Here's the setup:
- In Shopify, create a discount. Go to Discounts, then Create Discount. Choose "Amount off order" or "Amount off products" or whatever type you need.
- Set the discount value (e.g., 15% off).
- Under "Discount code," select the option that says "Generate discount codes."
- Don't generate codes manually — Klaviyo will do this automatically.
- Save the discount in Shopify.
Now in Klaviyo:
- Open the flow email where you want to include a unique code
- In the email editor, click "Add coupon code"
- Select "Dynamic" (unique per recipient)
- Connect it to the Shopify discount you created
- Set the code format (prefix, length, character type)
- Set expiration (number of days after the code is generated)
- Insert the dynamic coupon code into your email using the coupon code tag
When the flow email sends, Klaviyo generates a unique code for that specific recipient and inserts it into the email. The code gets created in Shopify simultaneously, so it's valid immediately when the customer tries to use it.
Expiration Strategy
Expiration is where the psychology gets interesting. A code that never expires creates no urgency. A code that expires in 2 hours creates anxiety. Finding the sweet spot is key.
Here's what we use for different flow types:
Welcome flow discount: 7-14 days. New subscribers need time to browse your store, evaluate products, and make a decision. A 72-hour window is too aggressive for someone who just discovered your brand.
Abandoned cart discount (if you use one): 48-72 hours. The purchase intent is already there. The code is a nudge, and it shouldn't stay open indefinitely.
Browse abandonment discount: 72 hours. Similar to abandoned cart but slightly longer because the intent is lower (they browsed but didn't add to cart).
Win-back discount: 14-30 days. These customers haven't purchased in a while. They need time to come back and browse. Too short an expiration and they'll miss it entirely.
VIP exclusive offers: 7 days. VIP customers are engaged enough to act within a week. The exclusivity of a limited window reinforces the VIP feeling.
Post-purchase cross-sell: 14 days. Give them time to receive and use their purchase before pushing the next buy.
Always display the expiration clearly in the email. "Your code expires on [date]" or "Valid for the next 7 days." Don't hide it. The countdown is part of the persuasion.
Code Format Best Practices
Klaviyo lets you customize the code format. Get this right for a professional experience:
Use a recognizable prefix. "WELCOME-XHGT4K" is better than "XHGT4K." The prefix tells the customer (and your team) what the code is for.
Keep it short. 8-10 characters total (including prefix). Long codes are annoying to type on mobile, even with copy-paste. "VIP-K4MN" is better than "VIPWELCOME-XHGT4KMN92P."
Avoid confusing characters. Configure Klaviyo to exclude characters that look similar: O/0, I/l/1, S/5. This prevents customer support tickets from people who can't figure out if that's a zero or an O.
Make it uppercase. Uppercase codes look more official and are easier to read. Configure Klaviyo to generate uppercase alphanumeric codes.
Unique vs. Static Codes: When to Use Each
Unique codes aren't always the right choice. Here's the decision framework:
Use Unique Codes When:
- The discount is significant (10%+ off). Higher-value discounts are more likely to get shared on coupon sites. Unique codes prevent this.
- The flow targets a specific segment. Welcome codes for new subscribers, VIP codes for loyal customers — these should be exclusive.
- You want to track redemption by flow. Unique codes let you see exactly how many people used the code from a specific email in a specific flow.
- You want genuine urgency. Expiring unique codes create real deadlines. Static codes with "expires soon" feel fake because the customer suspects (correctly) that the code will still work next week.
- You're A/B testing offers. Unique codes let you measure the exact impact of a 10% vs. 15% offer because each code is tied to a specific email version.
Use Static Codes When:
- The discount is small and you want broad distribution. A 5% off code that's the same for everyone is fine for a newsletter footer.
- The code is shared intentionally. Influencer codes (SARAH15), referral codes, and partner codes should be static so they can be shared.
- You're running a site-wide sale. Everyone gets the same discount. A unique code per person adds complexity without benefit.
- Simplicity matters. For a one-off campaign where tracking granularity isn't important, a static code is faster to set up.
Common Mistakes
Not Setting Usage Limits
Unique codes in Klaviyo are set to "one use per customer" by default. But verify this in your Shopify discount settings. If the limit isn't set, a customer could technically use their "unique" code multiple times by checking out with different email addresses.
Generating Too Many Unused Codes
Every unique code Klaviyo generates gets created in Shopify. If your flow sends 10,000 emails and only 500 people redeem, you now have 9,500 unused discount codes in your Shopify admin. Over time, this can slow down your discount management.
Periodically clean up expired, unused codes in Shopify. Or use Klaviyo's "generate code at send time" approach (which is the default) rather than pre-generating thousands of codes.
Stacking with Other Discounts
If your store allows discount stacking (using multiple codes at checkout), a customer could combine their unique welcome code with a sale that's already running. Configure your Shopify discounts to control stacking behavior:
- "This discount can't be combined with other discounts" — prevents stacking
- "This discount can be combined with other product discounts" — allows stacking (careful with this)
For most flows, prevent stacking. The unique code is the offer. Don't let it stack with other promotions.
Not Testing the Code
Before activating a flow with unique codes, test it. Subscribe to your own list with a test email. Receive the flow email. Copy the code. Go to your store and try to use it. Verify that the discount applies correctly, the expiration is right, and the code format looks good.
We've seen flows run for weeks with broken coupon codes because nobody tested them. That's revenue and credibility lost.
Forgetting About the Thank You / Confirmation Email
When a subscriber gets a unique code and uses it, your order confirmation email should reference the discount applied. "You saved $12 with code WELCOME-K4MN!" This reinforces the value of being a subscriber and validates their decision to sign up.
Advanced: Conditional Discounts
You can get creative with conditional logic in flows:
- If customer's cart value was above $100, generate a 15% unique code
- If customer's cart value was below $100, generate a 10% unique code
- If customer has purchased before (repeat buyer), skip the discount entirely
- If customer is a VIP, generate a 20% code
This prevents giving discounts where they're not needed (repeat buyers who would purchase anyway) and increases the incentive where it matters (first-time buyers on the fence).
Use Klaviyo's conditional splits in your flows to route different customer types to different email branches with different coupon configurations.
Measuring Coupon Performance
Track these metrics for each flow that uses unique codes:
- Redemption rate. What percentage of generated codes get used? Target: 8-15% for welcome flows, 5-10% for win-back flows.
- Revenue attributed to coupon. Total revenue from orders that used the coupon code. This is your flow's dollar impact.
- Average discount value. What's the average dollar discount per redemption? Make sure it's in line with your margin targets.
- Time to redemption. How quickly after receiving the code do people use it? This tells you if your expiration window is right.
- Coupon code abuse rate. Are codes showing up on coupon sites? Check sites like Honey, RetailMeNot, and CouponFollow periodically. Unique codes should have zero presence on these sites.
The Bottom Line
Unique coupon codes in Klaviyo flows are more valuable than static codes for every automated email where you're offering a discount. They prevent sharing, enable tracking, create genuine urgency through expiration, and give you precise data on flow performance.
Set them up correctly. Configure the format, expiration, and usage limits. Test before activating. And track the metrics to optimize over time.
If you want help building Klaviyo flows with optimized coupon strategies, book a call with our team. We'll configure your flows for maximum revenue and minimum discount leakage.

Written by Mark Cijo
Founder of GOSH Digital. Klaviyo Gold Partner. Helping eCommerce brands grow revenue through data-driven marketing.
Book a free strategy call →