# Klaviyo x Smartrr Integration

Last updated: May 14, 2025

{% hint style="warning" %}
**Effective December 28, 2023**, Smartrr now requires both public *and* private Klaviyo API keys for all shops. If you’re an existing merchant who has enabled our Klaviyo integration, please create a private API key from within your Klaviyo admin. For detailed instructions on how to do this, please visit. [<mark style="color:blue;">Klaviyo’s help documentation</mark>](https://help.klaviyo.com/hc/en-us/articles/115005062267). Then, please add this private API key into Smartrr by going to Integrations > Klaviyo > Update. Please complete this action as soon as possible in order to avoid disruption to your Smartrr <> Klaviyo integration.\
\
![](https://3658670565-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FndNAuxS4koYyI8AQTpS9%2Fuploads%2F2g2AaNBNkCZR2Oao7DDW%2FKlaviyo%20Update.gif?alt=media\&token=d599d07b-f99d-488b-85e0-afb5cb328219)
{% endhint %}

### How it works

Smartrr's integration with Klaviyo can be used in conjunction with or in place of Smartrr's native email [<mark style="color:blue;">Customer Notifications</mark>](https://help.smartrr.com/docs/support/subscription-setup/email-subscription-notifications-customer-notifications).&#x20;

The following triggers are available to be passed from Smartrr to Klaviyo:&#x20;

| Trigger Name                                     | Fired when...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Smartrr: Subscription created**                | **🆕** A customer has purchased a brand new subscription from your shop                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Smartrr: Subscription upcoming order**         | **🔜** A customer has an upcoming subscription order in 3 days                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Smartrr: Subscription send now**               | <p><strong>📦</strong> A customer has hit <strong>Send Now</strong> on their next subscription order in their account portal <br><br><em>Note: The "Send now" button ensures the subscription order will be processed at your shop's next</em> <a href="../transactions/billing-schedule"><em><mark style="color:blue;">Billing Time</mark></em></a><em>. This is different from when Shopify creates the order and an order confirmation email is sent to the customer. When using this trigger in emails, we recommend using language like: "Your order will be processed within the next 24 hours." or "Your order will be processed on the next business day."</em></p> |
| **Smartrr: Transaction successful**              | **💳** A customer's order has successfully been run during your shop's [*<mark style="color:blue;">Billing Time</mark>*](https://help.smartrr.com/docs/support/transactions/billing-schedule)                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Smartrr: Transaction attempt failed**          | **❌** A customer's order has failed during your shop's [*<mark style="color:blue;">Billing Time</mark>*](https://help.smartrr.com/docs/support/transactions/billing-schedule)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Smartrr: Subscription skipped**                | **⏭** A customer or admin has skipped an upcoming order                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Smartrr: Subscription unskipped**              | **⏮** A customer or admin has unskipped an upcoming order                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **Smartrr: Subscription gifted**                 | **🎁** A customer has gifted an upcoming order                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Smartrr: Subscription next order date change** | **📅** A customer or admin has changed/delayed the date of customer's next order                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Smartrr: Subscription product unavailable**    | 🚫 A product in the customer's subscription has become unavailable (out of stock, deleted/archived, etc.)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **Smartrr: Subscription canceled**               | **🔚** A customer or admin has permanently canceled a customer's recurring subscription                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Smartrr: Subscription paused**                 | ⏸️ A customer or admin has temporarily paused a customer's recurring subscription                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Smartrr: Subscription activated (unpaused)**   | **▶️** An admin has re-activated a customer's paused subscription in the admin portal                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **Smartrr: Subscription auto-resume**            | ⏯️ Sent 7 days before a paused subscription is set to auto-resume                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Smartrr: Loyalty points earned**               | 🔺 A customer has earned loyalty points                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Smartrr: Bonus points earned**                 | ➕ A customer qualifies for a bonus earn event and receives additional points                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| **Smartrr: Successful referral**                 | 🤝 A customer when someone has successfully used their referral code                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **Smartrr: Loyalty points redeemed**             | 💰 A customer has redeemed some % of their loyalty points                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **Smartrr: Referral code generated**             | 🧑‍💻 A customer has generated a referral code to be shared                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **Smartrr: Loyalty Tier Advancement**            | ☝️A customer has advanced up to the next tier                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

### Custom Properties

In addition to passing triggers, the following custom properties will be passed to individual Klaviyo profiles:&#x20;

#### Customer Context

```
$email: string;
customer_shopify_id?: string;
customer_smartrr_id: string;
active_subscriptions_count: number;
customer_currency: CurrencyCode;
order_count: number;
total_spent: string;
$first_name?: string;
$last_name?: string;
$phone_number?: string;
$address1?: string;
$address2?: string;
$city?: string;
$zip?: string;
$region?: string;
$country?: string;
```

#### Item Context

```
item_variant_smartrr_id: string;
item_variant_shopify_id: string;
item_variant_name: string;
item_variant_image: string;
quantity: number;
currency: string;
price: string;
sku: string;
item_smartrr_id: string;
item_shopify_id: string;
item_image: string;
item_image_small: string;
item_name: string;
```

#### Subscription Context

```
subscription_smartrr_id: string;
subscription_shopify_id: string;
next_order_date: string;
items: string;
item_names: [string];
item_variant_names: [string];
status: string;
frequency_unit: string;
delivery_frequency: number;
payment_frequency: number;
total_estimated_tax: number;
total_discounts: number;
total_line_items_price: number;
total_line_items_price_after_discount: number;
total_estimated_net: number;
total_shipping: number;
shipping_address1: string;
shipping_address2: string;
shipping_province: string;
shipping_province_code: string;
shipping_city: string;
shipping_country: "string;
shipping_country_code: string;
shipping_zip: string;
shipping_first_name: string;
shipping_last_name: string;
cancellation_reason: string;
was_last_subscription: Boolean;
gift_id: string;
gift_email: string;
gift_phone: string;
gift_note: string;
gift_notify_by: string;
```

#### Loyalty Context

```
points_earned: number;
earn_event: string;
earn_date: string;
previous_point_balance: number;
current_point_balance: number;
previousTier: string;
newTier: string;
points_earned: number;
earn_date: string;
previous_point_balance: number;
current_point_balance: number;
referral_code: string;
referral_url: string;
referee_first_name: string;
points_earned: number;
referral_date: string;
previous_point_balance: number;
current_point_balance: number;
```

#### Payment Context

```
order_id: string;
order_shopify_id: string;
payment_id: string;
payment_shopify_id: string;
remaining_retries: number;
payment_id: string;
payment_shopify_id: string;
```

#### Order Context

```
upcoming_order_date: string;
next_date: string;
skipped_date: string;
unskipped_date: string;
```

## Setup

To integrate Klaviyo and Smartrr, grab your public API key from your Klaviyo dashboard under **Account** > **Settings** > **API Keys**.

![](https://3658670565-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FndNAuxS4koYyI8AQTpS9%2Fuploads%2Fl2M21kdWkZURbgyABkLL%2FScreen%20Shot%202022-08-02%20at%203.55.03%20PM.png?alt=media\&token=a9f1bc91-fec4-4d62-bebc-a9862b6e0a6b)

Your **Public API Key** is pre-generated at the top of the page. Copy this key.&#x20;

![](https://3658670565-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FndNAuxS4koYyI8AQTpS9%2Fuploads%2FEtnwxzaSnw95BaYObVRv%2FScreen%20Shot%202022-08-02%20at%204.08.52%20PM.png?alt=media\&token=e465502d-6540-4171-a4f5-582cb721e0f5)

In your Smartrr dashboard, navigate to **Integrations**. Under **Manual Integrations**, find Klaviyo and press **Connect** to enter the public API key you copied from Klaviyo.&#x20;

<figure><img src="https://3658670565-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FndNAuxS4koYyI8AQTpS9%2Fuploads%2F4LjKpWNVO1ATsvETsfpS%2Fklaviyo-connect.png?alt=media&#x26;token=db6cc325-ae4b-45e8-8ebd-6836b67f3878" alt=""><figcaption></figcaption></figure>

Once successfully connected, the triggers [<mark style="color:blue;">listed above</mark>](#how-it-works) will sync as soon as the metric itself fires.&#x20;

{% hint style="info" %}
Heads up: Since Smartrr syncs real-time information into Klaviyo, make sure to take this into consideration when planning out your Klaviyo flows. For example, a flow triggered by the **Smartrr: subscription created** metric will trigger immediately after someone subscribes, which can result in inundating customers with 3+ emails if they are already receiving both "Welcome" and "Order Confirmation" emails.
{% endhint %}

So that you can immediately begin using all Smartrr-related metrics in your Klaviyo flows, upon successful connection we will immediately create a profile in your Klaviyo **"<hello@smartrr.com>"** that will fire all 11 available triggers once. ✅

### Customer Profiles & Payloads

Once your integration is setup and syncing, you'll also be able to view subscription-level metrics detail on customer profiles within Klaviyo.&#x20;

![](https://3658670565-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FndNAuxS4koYyI8AQTpS9%2Fuploads%2F0grnlFJVqOubVNH6oMZa%2FScreen%20Shot%202022-08-02%20at%204.20.23%20PM.png?alt=media\&token=cc67d804-d1f6-47c3-8a7c-bfde5abef79b)

Click on **Details** to view the payload information that is passed along with each individual metric.&#x20;

![Press "Collapse" to hide the information payload once opened.](https://3658670565-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FndNAuxS4koYyI8AQTpS9%2Fuploads%2FQqih8DPqw8VodSeTNpwo%2FScreen%20Shot%202022-08-02%20at%204.21.11%20PM.png?alt=media\&token=fca3c1c0-bea5-4f68-ac61-f7acf65d8693)

The information in the payload can be referenced as dynamic tags when designing your Klaviyo emails. For example, if you started a flow with the trigger **Smartrr: Subscription created** and wanted to reference one of the events in the payload, use the tag `{{ event.`<mark style="color:orange;">`event_name`</mark>`}}` replacing <mark style="color:orange;">`event name`</mark> with your desired variable in the body of your email.&#x20;

If you have a payload in array form, such as **items**, you can loop through the array to find a specific result. [<mark style="color:blue;">Click here to read more about how to use Klaviyo's dynamic variable tags</mark>](https://help.klaviyo.com/hc/en-us/articles/115005084927-Guide-to-Template-Tags-and-Variable-Syntax#event-variables-4)<mark style="color:blue;">.</mark>

You can use Klaviyo's preview feature to help locate tags. When in preview mode for a flow email for a customer, click in the information you'd like to populate and the corresponding tag will display. In the below example, we've clicked on the with the dynamic tag for subscription frequency: `{{ event.frequency_unit }}` . When put into the body of an email this will render the word "month" in the customer's email.

![](https://3658670565-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FndNAuxS4koYyI8AQTpS9%2Fuploads%2FsY1T48xjmPGyj1ackkir%2FScreen%20Shot%202022-08-02%20at%204.58.18%20PM.png?alt=media\&token=81793705-7580-430a-b69b-8a16b63cfa6e)
