TL;DR: There are two coupon types in Klaviyo emails: static (same code for everyone) and dynamic (unique code per person). Static codes go directly into a text block. Dynamic codes require setting up a coupon in Klaviyo first, then inserting via a Coupon block or the {% coupon_code 'CouponName' %} tag.
Depending on the type of message you're sending, there are two different ways to add a link to an email in order to automatically include a coupon to the recipients cart. For a dynamic coupon, such as in an abandoned cart flow, the structure of your link will look like this:
https://www.mysite.com/STOREFRONT_ID/checkouts/{{ event.extra.token }}?discount={% coupon_code 'NAME_OF_YOUR_COUPON' %}
If you're using a static coupon, then instead of appearing like
{% coupon_code 'NAME_OF_YOUR_COUPON' %}
it will just be:
?discount=NAME_OF_YOUR_COUPON.
Head to this article on Add a Link that Automatically Applies a Unique Coupon Code at Checkout for more information.
For any other flow or campaign message, you will need to point to your website, add the coupon and redirect all within the same link. That would look like this:
mysite.com/discount/{% coupon_code 'your_code' %}?redirect=/new-path
Again, if you're not using a dynamic code, you can replace that tag with just your static coupon's name.
mysite.com/discount/{% coupon_code 'your_code' %}?redirect=/new-path
Setting up dynamic/unique coupons by platform
Before you can insert a dynamic coupon, you need codes in Klaviyo:
- Shopify, Magento, WooCommerce, PrestaShop: Create unique coupons directly in Klaviyo - codes auto-generate for flows. Campaigns require pre-generated codes.
- Other platforms: Generate codes externally → go to Content → Coupons → Uploaded Coupons → Create Uploaded Coupon → use the three-dot menu → Add Codes (CSV with a "Coupon" column header).
Two ways to insert a dynamic coupon into your email
- Coupon block (drag-and-drop): Drag the Coupon block into your email → click + → select your coupon. Only coupons with available, unexpired codes will appear. The code assigns when the email renders. Avoid adding excessive coupon blocks in a single email.
- Template tag in a text block: Add
{% coupon_code 'CouponName' %}using the exact coupon name as it appears in Klaviyo.
Testing and sending tips
- In-app preview shows
COUPON_NAME-PREVIEW- this is expected. Real codes only generate on live sends or inbox previews. - Campaigns: Ensure you have enough codes before scheduling - Klaviyo will block the send if available codes are fewer than recipients.
- Flows: Klaviyo-generated codes (e.g. Shopify) replenish automatically. Uploaded codes require you to manually keep inventory stocked.


