You can now add a unique discount code into your Klaviyo email content, that is linked to a Shopcada discount.
Prerequisites:
- After creating your discount on Shopcada, do take note of its Discount ID:
- When creating your discount on Shopcada to be linked later on, do ensure you have the "Require discount code to activate this discount" setting enabled:
Setting Up on Klaviyo:
- From the left pane under Actions > Drag and drop the Webhook action before the Email action
- Click on "Set up Webhook"
- Set the Destination URL as
https://<your domain name>/api/plugin/klaviyo/discount
Ensure that you change <your domain name> to your actual domain name ie. https://testingsite.com/api/plugin/klaviyo/discount - Set the JSON Body as such:
{
"discount_id": [discount id],
"expire_in": [expire in],
"profile_id": "{{ person.KlaviyoID }}",
"email": "{{ person.email }}"
}
❗️Note: Do remove the [ ] square brackets for Discount ID and Expire In.
discount_id: Replace "[discount id]" with the discount ID created on Shopcada. This can be found at the top of the discount configuration page.
expire_in: Replace "[expire in]" with the number of days the discount code will expire, from the time of generation.
profile_id and email are both required, and to be copied exactly as shown above. Do not modify it.
An example of what your JSON Body should look like:{
"discount_id": 3,
"expire_in": 7,
"profile_id": "{{ person.KlaviyoID }}",
"email": "{{ person.email }}"
}
- After you're done, scroll up slightly, and click on "Preview" located above the Destination URL field.
- Scroll down on the pop up > Click on Send Test Request
- To ensure that the discount code has fully synced to Klaviyo, add a 1-5 mins Time Delay between Webhook Action and Email Action.
- To add the discount code token into your email content, click on "Add personalization" and add discount_code.
Once added it should show: {{ person|lookup:"discount_code"|default:'' }} - Your set up is done! Do preview and test out your email to ensure your email and discount are working as intended.