Add a Link that Automatically Applies a Unique Coupon Code at Checkout

read

Overview

Adding a link that automatically applies a unique coupon code to a customer's cart on the checkout page makes it incredibly easy for a customer to click through and place an order. It is also possible to create a link that applies a coupon code to a customer's cart, but this method will take the shopper directly to the checkout page.

Additionally, this will be effective across devices -- this means that if a customer abandons a cart on desktop but receives and clicks through your email on mobile, their cart will be up to date.

Create a Unique Coupon Code

Before you are able to apply the code to a URL, you'll need to build your coupon code in the Coupons tab. To do this, follow the instructions outlined in this article.

Add the Discount URL to a Template

When constructing the URL, you will need to use the following format:

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

This token reconstructs the checkout and is unique in each Started Checkout event in Klaviyo. You will need to fill in "mysite" with your website URL, "STOREFRONT_ID" with your unique storefront ID, and "NAME_OF_YOUR_COUPON" with the coupon name (must be an exact match of the name -- capitalization matters).

You can find your storefront ID by clicking on the event data for a Started Checkout event and grabbing the first part of a checkout_url.

First, navigate to your Metrics tab and select Checkout Started. Here, click on the timestamp for one of the events.

2018-10-29_11-06-09.png

This will open the metadata associated with this event. After your site's URL, you will see the storefront ID associated with your account.

2018-10-29_11-07-20.png

Once you've constructed the token, you can insert it into your abandoned cart email template.

Was this article helpful?
3 out of 4 found this helpful