Skip to main content

How to setup the Klaviyo Integration

Sync real-time data directly into your Klaviyo account and automatically trigger personalized emails.

Written by Milos

Simple Affiliate Klaviyo Integration

Our Klaviyo integration is a powerful tool for Shopify merchants who want to put their affiliate communication on autopilot. By syncing real-time data directly into your Klaviyo account, you can trigger personalized emails the moment a partner is approved or whenever they secure a new sale. Klaviyo is a critical part of many Shopify stores, and these events allow for a seamless communication experience.


How the Klaviyo Integration Works

This integration passes two specific metrics to your Klaviyo account. These metrics will be accessible when creating a flow in Klaviyo—simply search for the metric names to begin. If you're new to Klaviyo, see the template tag cheat sheet below.


How to Set Up the Integration

To connect your accounts, you will need a Private API Key from your Klaviyo dashboard.

  1. Where to Setup: From your main merchant dashboard, go to Settings > Emails.

  2. Enable the Integration: Scroll down to the Klaviyo section and check the box for "Enable Klaviyo integration."

  3. Enter Your API Key: Paste your Private API key into the designated field.

    • Security Note: For your protection, the API key will no longer be visible after you click save. Make sure you have stored it somewhere safe.

  4. Disable Welcome Emails: If you plan to send welcome emails via Klaviyo, uncheck the "Affiliate account welcome" box. This prevents the affiliate from receiving two separate welcome emails.

  5. Save: Click the Save button.

To Remove the Integration

  1. Click the delete icon beside the API key.

  2. Uncheck the Enable Klaviyo integration box.

  3. Click Save.


Technical Event Data (Payloads)

The following data is passed to Klaviyo via POST https://a.klaviyo.com/api/events (Revision: 2026-01-15). You can use any of these "Properties" to personalize your emails.

1. Simple Affiliate Referral Confirmed

Use this metric to send "You've got a sale!" notifications. To use a referral property in a Klaviyo email, follow the Klaviyo syntax: {{ event.commission_amount }}.

  • event: Klaviyo data type identifier

  • commission_amount: Simple Affiliate referral property

A list of all available Affiliate Approved properties can be found below:

{
"data": {
"type": "event",
"attributes": {
"unique_id": "sa-referral-confirmed-482913",
"properties": {
"referral_id": "482913",
"affiliate_id": "10457",
"affiliate_first_name": "Jane",
"affiliate_last_name": "Doe",
"sh_order_name": "#1042",
"commission_amount": "$12.50"
}
}
}
}


2. Simple Affiliate Affiliate Approved

Use this to deliver discount codes and onboarding instructions. To use the affiliate's name in an email, follow the Klaviyo syntax: {{ event.affiliate_first_name }}.

  • event: Klaviyo data type identifier

  • affiliate_first_name: Simple Affiliate referral property

A list of all available Affiliate Approved properties can be found below:

{
"data": {
"type": "event",
"attributes": {
"unique_id": "sa-affiliate-approved-10457-2026-04-16T17:24:08.512Z",
"properties": {
"affiliate_id": "10457",
"affiliate_first_name": "Jane",
"affiliate_last_name": "Doe",
"affiliate_discount_code": "JANE10",
"affiliate_group_name": "Content Creators"
}
}
}
}


Klaviyo Template Cheat Sheet

When building your flows in Klaviyo, you can use Template Tags to dynamically insert affiliate data into your subject lines or email bodies.

Common Referral Tags

Use these in your "Confirmed Sale" flows to show affiliates exactly what they earned:

  • Affiliate Name: {{ event.affiliate_first_name }}

  • Commission Earned: {{ event.commission_amount }}

  • Order Reference: {{ event.sh_order_name }}

Common Approval Tags

Use these in your "Welcome" flows to give new partners their assets immediately:

  • Discount Code: {{ event.affiliate_discount_code }}

  • Assigned Group: {{ event.affiliate_group_name }}

  • Affiliate Name: {{ event.affiliate_id }}


Important Rules to Remember

  • Profile Mapping: The email attribute in the payload is always the affiliate's email. This ensures the event is tied to the affiliate's profile in Klaviyo, not the customer's.

  • Deduplication: We include a unique_id to prevent duplicate events from triggering the same flow twice.

  • Currency Formatting: The commission_amount is passed as a localized string (e.g., "$12.50" or "€9,95") based on your store's settings.

  • Null Values: Properties like affiliate_discount_code or sh_order_name may be null or empty if the data hasn't been generated in Shopify yet.

Did this answer your question?