You will learn
Learn how to set up a price rule in Magento 2 and create the coupons in Klaviyo so that your shoppers can easily apply a discount during the checkout process. Magento supports shopping cart price rules.
Klaviyo's Coupons allow Magento 2 stores to do the following:
- Create new coupons in Klaviyo associated with pre-existing price rules in Magento.
- Include unique (also called "dynamic") coupons within flow emails, so each recipient receives a unique code.
This guide will walk you through creating a Magento 2 coupon in Klaviyo in 2 steps:
- Setup a price rule in Magento 2.
- Create the coupon in Klaviyo.
If you would like to send campaign emails with unique coupon codes for Magento 2, follow this guide on uploading unique coupons into Klaviyo and using them in a message.
Before you begin
Before you begin, make sure that you've enabled the Magento 2 integration in Klaviyo and installed the Klaviyo extension in Magento.
Setup a price rule in Magento 2Setup a price rule in Magento 2
1. From your Magento 2 store navigate to Marketing > Cart Price Rule.
2. Create a price rule by clicking Add New Rule.
3. Fill in the rule information:
- Rule Name: the name of the price rule in Magento 2.
- Active: choose Yes. If Yes is not selected, the coupon will not work.
- Websites: if you only have one Magento store, choose the name of your website. If you have multiple Magento stores, choose the store the coupon is associated with.
- Customer Groups: choose NOT LOGGED IN, or choose a different customer group.
- Coupon: choose Specific Coupon from the drop-down.
- Coupon Code: you don’t need to enter anything in this field; Klaviyo will automatically generate coupon codes for you.
- Use Auto Generation: you must enable this field. If you don’t enable this field, Klaviyo will not be able to generate coupon codes.
- Uses per Coupon: the number of times your coupon can be used; usually this value will be 1.
- Uses per Customer: the number of times your coupon can be used per customers; usually this value will be 1.
- From -- To: enter the date range during which the coupon will be valid; the To date will be the coupon's expiration date.
Coupons set to never expire will still show an expiry date of 1 year listed in Klaviyo, however they will not expire.
4. At the bottom of your New Cart Price Rule screen, you’ll see additional settings. Conditions, Actions, and Labels settings are optional and will impact how coupons are applied in your Magento 2 store; these won’t affect Klaviyo Coupon generation.
5. Manage coupon codes: these settings don’t need to be filled in. When Klaviyo generates coupon codes, those codes will appear in this section.
6. When you’re finished, click Save on the upper right corner of your screen.
7. View your list of Magento 2 coupons. Each Magento 2 coupon is associated with an ID. Take note of the ID of the coupon you created. You’ll need it in the next step.
Create a Magento coupon in KlaviyoCreate a Magento coupon in Klaviyo
Next, you’ll create a coupon in Klaviyo. For this step, you need the ID associated with the price rule you just created in your Magento 2 account. A new coupon created in Klaviyo must reference a pre-existing Price Rule in Magento.
1. Navigate to your Coupons section and select Magento 2 Coupons.
2. Click Add Coupon to create a new coupon.
3. Enter a name for your coupon in the Coupon Name field, and enter the Magento 2 price rule ID associated with this coupon. Again, you need to have created a price rule in Magento 2 before you create a coupon in Klaviyo. Head back to your Magento 2 account if you need to reference this ID number again.
4. When you're finished click Add Coupon.
5. You’ve created your new coupon.
Use a Magento coupon in a flow emailUse a Magento coupon in a flow email
Once a coupon is created, you can insert it into a flow email. Note that you can only use 1 coupon code per email. Also, you can display the same coupon code in multiple places, but you cannot use multiple codes.
To insert a coupon into your flow email, use the following placeholder variable:
{% coupon_code 'CouponName' %}
.
Replace CouponName with the name of the coupon. For example:
Note that the Magento 2 coupons are automatically generated when you send the flow email.
Using coupons in SMS flow messages
Unique coupons are also available for your SMS/MMS messages in flows. Generate the codes just like you would for email. Then, use the template tag below to add the coupon code to your SMS or MMS message:
{% coupon_code 'CouponName' %}
.
In the snippet, change CouponName to the name of the coupon you want and add it into the message.
You can only use 1 coupon code per SMS message. If you try to use more than 1, you will receive the following error.
Additional resourcesAdditional resources
- How to set up coupons (for Magento 1.x)
- How to view coupon history
- Troubleshooting your Magento 2 integration