Solved

How to add a link in my welcome series that applies a coupon code to a Shopify cart

  • 12 December 2023
  • 6 replies
  • 123 views

Userlevel 2
Badge +6

Hey there.

I’d like to be able to add a link in my welcome series that applies a coupon code to a Shopify cart.

I read this article : https://help.klaviyo.com/hc/en-us/articles/115005253088 and tried this : 
 

mysite.com/discount/CouponName

mysite.com/?discount=CouponName

mysite.com/discount/{% coupon_code 'CouponName' 

 

When someone I click the link in the welcome email I get, it doesn’t apply the coupon on the cart (I’m not on Preview mode).

Can you help me please.

Thanks.

Steve

icon

Best answer by bluesnapper 13 December 2023, 08:43

View original

6 replies

Userlevel 7
Badge +37

Hi @Steve0603

If you have that discount created in Shopify, say WELCOME10 for 10%, then the static link to use for that is:

my site.com/discount/WELCOME10

That will automatically apply the WELCOME10 discount to their cart.

Let me know how you get on

Regards

Andy 

Userlevel 2
Badge +6

Hey @bluesnapper I created the coupon code directly in Klaviyo, which is the same as creating it in Shopify, right ? 

Thanks

Userlevel 7
Badge +37

Hi @Steve0603 

A coupon created in Shopify is static: you set the discount parameters and a start date and an end date or set never to expire. Those conditions apply to everyone who receives it, irrespective of when they receive it.

This type of static coupon is useful for a ‘welcome’ flow; one where a contact enters when they subscribe to an introductory discount e.g signing up for your newsletter. A static coupon can be shared but that would encourage sales so usually not an issue. To automatically apply that static coupon from a link in a flow or campaign: mysite.com/discount/WELCOME10 (using my coupon example).

The same static coupon can also be used in event-based flows, for example, abandoned checkouts where the cart link is dynamic. For Shopify, the link would be {{ event.extra.checkout_url }}&discount=WELCOME10

A Shopify coupon created in Klaviyo is dynamic and Klaviyo will generate one that's unique to each recipient. You can set the coupon as active at send-time or on a specific date during creation. You can also set its expiration: never, after a certain number of days/hours after it's been sent, or on a specific date. A dynamic coupon is useful for flows/campaigns where you would not want the coupon to be shared (if it's a bigger discount) and where you want to tie the expiration date to when the contact receives the coupon. For example, VIP flows, win-back flows etc. 

For Shopify, the parameter to add to your dynamic urls is: &discount={% coupon_code 'WELCOME10' %} or for static ones: mysite.com/discount/{% coupon_code 'WELCOME10' %}.

If you've created that WELCOME10 coupon in Klaviyo using the prefix 'WELCOME10-' then Klaviyo will insert WELCOME10-XXXXXXXX where the X's are 8 random letters unique to each recipient. That recipient will always receive the same coupon code when the {% coupon_code 'WELCOME10' %} code snippet is included in any campaign or flow.

Does that help?

Regards

Andy

Userlevel 2
Badge +6

@bluesnapper brillant ! Veryyy helpfull ! Thanks a lot buddy ! 

Userlevel 7
Badge +37

No problem @Steve0603 Pleased I could help!

Regards

Andy

Userlevel 2
Badge +6

Hey @bluesnapper last question.

Right now, I’m using “mysite.com/discount/WELCOME10

Which is good, but the coupon code that shows on the cart is WELCOME10

And my client wants it as dynamic, eg: WELCOME107597624556

So you’re saying that in order to be able to do that, I have to put this URL : mysite.com/&discount={% coupon_code 'WELCOME10' %} in the CTA button ? 

I tried it and it shows a 404 page...

Thanks again, you rock ! 

Reply