Skip to main content
Solved

Shopify Discount Code link and Abandon cart

  • January 15, 2021
  • 9 replies
  • 1953 views

Forum|alt.badge.img+2

Hey Everyone,

Really trying to dial in my abandon cart flow and want to make things as simple as possible for a customer. I don’t want the customer to have to remember a code when they go back to their cart to checkout. My button in Klayvio has:

Link URL: {{ event.extra.checkout_url}}

The Shopify Discount Link is: https://everbloombaby.com/discount/12345

How can I have the button for the event also have the automated discount???

Any insight would be super helpful!!!

Best answer by ksanfelipe

Hey @EverBloom ,

If you are using a static code (ie, everyone is receiving the same 12345 code), you can use the following URL to drive them back to checkout with the code auto-applied:

{{ event.extra.responsive_checkout_url }}&discount=12345

Note that you may need to replace the & with ?

 

Reply back if you have any questions!

View original
Did this topic or the replies in the thread help you find an answer to your question?

9 replies

retention
Partner - Platinum
Forum|alt.badge.img+62
  • 2025 Champion
  • 942 replies
  • January 15, 2021

Hi @EverBloom 

This is a very cool feature that helps customers a lot.
You can find instructions on how to create a link that automatically applies coupon code in our tutorial here.
That should help you understand the basics of how it works and how to apply it in Klaviyo emails.

Now for the abandoned cart email, is a little trickier because the checkout URL is being reconstructed at the site and if you want to auto apply coupon code, you can’t use the {{ event.extra.checkout_url}} in your button.

In this case, you need to use this link format:

https://www.mysite.com/STOREFRONT_ID/checkouts/{{ event.extra.token }}?discount={% coupon_code 'NAME_OF_YOUR_COUPON' %}

In your case it will be:

https://www.everbloombaby.com/7900037209/checkouts/{{ event.extra.token }}?discount=12345 %}


You can read more about this specific case in Klaviyo’s documentation here.

Hope this helps!

 


ksanfelipe
Klaviyo Employee
Forum|alt.badge.img+10
  • Klaviyo Employee
  • 29 replies
  • Answer
  • January 15, 2021

Hey @EverBloom ,

If you are using a static code (ie, everyone is receiving the same 12345 code), you can use the following URL to drive them back to checkout with the code auto-applied:

{{ event.extra.responsive_checkout_url }}&discount=12345

Note that you may need to replace the & with ?

 

Reply back if you have any questions!


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 1 reply
  • January 15, 2021

Awesome!!! That was super easy to fix 😃


sourabhramsingh
Problem Solver I
Forum|alt.badge.img+4

Hey @retention,

I went through your tutorial about creating and applying dynamic coupon codes and I must say that it was really insightful and I can see a lot of use cases for it in my email flows. 

Thank you for sharing. 


steez_brand
Active Contributor I
Forum|alt.badge.img+3
  • Active Contributor I
  • 10 replies
  • August 9, 2021
retention wrote:

Hi @EverBloom 

This is a very cool feature that helps customers a lot.
You can find instructions on how to create a link that automatically applies coupon code in our tutorial here.
That should help you understand the basics of how it works and how to apply it in Klaviyo emails.

Now for the abandoned cart email, is a little trickier because the checkout URL is being reconstructed at the site and if you want to auto apply coupon code, you can’t use the {{ event.extra.checkout_url}} in your button.

In this case, you need to use this link format:

https://www.mysite.com/STOREFRONT_ID/checkouts/{{ event.extra.token }}?discount={% coupon_code 'NAME_OF_YOUR_COUPON' %}

In your case it will be:

https://www.everbloombaby.com/7900037209/checkouts/{{ event.extra.token }}?discount=12345 %}


You can read more about this specific case in Klaviyo’s documentation here.

Hope this helps!

 

Is this still the way to do it? Every time I try and preview it, it doesn’t work and I’m seeing a COOKIES BLOCKED=1 in the URL.


David To
Klaviyo Employee
Forum|alt.badge.img+60
  • Klaviyo Employee
  • 2456 replies
  • August 9, 2021

Hello @steez_brand,

The suggest link format provided by @retention would be the correct way to dynamically link your Abandoned Cart email URLs with a coupon code. In addition to the wonderful blog article they linked, you can also find this information in the How to Add Link that Applies a Coupon Code to a Shopify Cart Help Center Article. 

The error message you are receiving seems to indicate that cookies were blocked when previewing. I would suggest opening the link in an incognito mode when previewing to see if that impacts anything. This can often times be caused if you have certain ad blocks, anti-viral softwares, etc. that may be causing these cookies to be blocked; thus preventing this functionality. 

I hope this helps!

David


Forum|alt.badge.img+1
  • Contributor I
  • 1 reply
  • April 20, 2022

Hi @David To and @ksanfelipe I tried both of these and the button link takes me to a blank https page. Can anyone help me with this?


  • Contributor I
  • 2 replies
  • July 3, 2024

Hey, I want to send the customers to the cart and not product page or checkout.

I have manage to made an setup that does so: 

https://URL.com/cart/add?id={{ event.extra.line_items.0.variant_id }}

BUT I would like to have an discount code implemented here.

So when the customer comes to cart the code is already activated.

Same as the example: {{ event.extra.responsive_checkout_url }}&discount=12345

Do anyone know how to solve it?

 


Forum|alt.badge.img+3
  • Active Contributor III
  • 22 replies
  • September 30, 2024

@M1999 did you get an answer to this?