Skip to main content
Solved

Dynamic Coupon Code - Click through from email across all comms in the journey

  • May 27, 2026
  • 3 replies
  • 23 views

Forum|alt.badge.img

Hi all,

I have a welcome series that I have set up for new subscribers that assigns them a dynamic coupon code when they register with our company.

The process is 

Welcome Pop Up on site, enter details receive coupon code. The same coupon code is then utilised across the entirety of our 7 day welcome series with 5 emails throughout that period.

Email 1 in the series displays the dynamic coupon that was assigned in their profile and we have a CTA that says shop now. I want the same coupon that is displayed in the email (the one that is on their profile) to be embedded into the CTA so it follows them through to our home page.

I have seen some documentation on how to do this however it is not clear if it will dynamically generate a new coupon code for each email in the series and not pull from the profile.

Currently the CTA is just directing to mysite.com

Thank you in advance

Best answer by ArpitBanjara

Hey ​@kaneelias 

When you use dynamic coupon code anywhere in a Klaviyo flow email (whether in the body text or inside a button URL), Klaviyo locks in one unique code per profile per coupon pool. It does not generate a fresh code each time the tag is rendered. So the code displayed in the email body and the code baked into your CTA URL will always be the same one, across every email in your 7-day welcome series.

You can also auto-apply this dynamic coupon code by setting the url in the below format

https://mysite.com/discount/{% coupon_code 'WELCOME10' %}  - you can replace WELCOME10 with whatever your actual coupon code name is.

if you want to send them to any other page on your website with this coupon code, you can use the below format

https://mysite.com/discount/{% coupon_code 'WELCOME10' %}?redirect=/collections/all

Always do a live test send to a real profile to confirm the code auto-applies properly at checkout.

I hope this helps and thank you for sharing your question here in the community. let me know if you have any follow up questions.

If you are still stuck, feel free to schedule a call with us here - https://flowium.com/lp/klaviyo-agency/

Cheers,

Arpit

3 replies

ArpitBanjara
Principal User II
Forum|alt.badge.img+37
  • Principal User II
  • Answer
  • May 27, 2026

Hey ​@kaneelias 

When you use dynamic coupon code anywhere in a Klaviyo flow email (whether in the body text or inside a button URL), Klaviyo locks in one unique code per profile per coupon pool. It does not generate a fresh code each time the tag is rendered. So the code displayed in the email body and the code baked into your CTA URL will always be the same one, across every email in your 7-day welcome series.

You can also auto-apply this dynamic coupon code by setting the url in the below format

https://mysite.com/discount/{% coupon_code 'WELCOME10' %}  - you can replace WELCOME10 with whatever your actual coupon code name is.

if you want to send them to any other page on your website with this coupon code, you can use the below format

https://mysite.com/discount/{% coupon_code 'WELCOME10' %}?redirect=/collections/all

Always do a live test send to a real profile to confirm the code auto-applies properly at checkout.

I hope this helps and thank you for sharing your question here in the community. let me know if you have any follow up questions.

If you are still stuck, feel free to schedule a call with us here - https://flowium.com/lp/klaviyo-agency/

Cheers,

Arpit


Forum|alt.badge.img
  • Author
  • Contributor I
  • May 27, 2026

Hi Arpit, thanks for the reply. I have attempted what you have suggested but I am getting a 404 error. Our site doesn’t seem to like having the code appended to the url. If I remove that discount line and the code the page loads correctly with all tracking information from Klaviyo. Must be an issue on our side and not necessarily Klaviyo


ArpitBanjara
Principal User II
Forum|alt.badge.img+37
  • Principal User II
  • May 27, 2026

Aha, which could mean that your store is not on shopify ​@kaneelias.

Yes, the /discount/ URL path is a Shopify-specific convention. For WooCommerce, Magento 1.x, Magento 2, and PrestaShop, Klaviyo doesn’t support generating unique coupon codes natively as of now. I mean there might be third party plugins that might make this possible, but this will be platform specific. 

which Ecommerce platform do you use?