Skip to main content
Klaviyo Integration

The following article will help you set up the Klaviyo x Stay integration and utilize the metrics and properties that are passed to Klaviyo.

Ashley Kim avatar
Written by Ashley Kim
Updated over 3 months ago

With Stay Ai's Klaviyo integration, Stay Ai passes various metrics to Klaviyo so you can use these metrics to trigger email flows and build segments. These metrics also allow you to take a deeper dive into analytics, so you can better understand where email-attributed conversions come from—new subscription purchases, recurring subscription orders, or one-time purchases.

Setting Up the Klaviyo Integration

  1. Log into your Klaviyo account.

  2. Click your account name dropdown in the top right corner and click “Account.”

  3. Navigate to Settings and click API Keys.

  4. Copy your public API key to your clipboard. This is a string of 6 random letters.

  5. Log into the Stay Ai app via your Shopify store.

  6. Navigate to Settings > Integrations.

  7. Click on the Klaviyo integration.

  8. Paste the public API key and hit save.

Understanding Stay Metrics in Klaviyo

Populating the Metrics in Klaviyo

Once Klaviyo has been successfully integrated, you are ready to populate metrics in their system. To populate the metrics, the actions respective to the metrics must take place on a subscription. For example, to trigger and thus populate the 'Retextion - Subscription Canceled' metric in Klaviyo, you must cancel a subscription in your store. Once the actions are completed, you can find them in Analytics > Metrics, then search “Retextion”. Below are the available metrics, once triggered.

Note: Since we have updated our company name, we will eventually be updating the metrics from "Retextion" to "Stay". In the interim, those listed above are correct.

General Subscription Metrics

Below are the metrics that are relevant to all subscription types.

  • Retextion - Subscription Started - This metric is triggered by checkout subscription orders and indicates the creation of a new subscription

  • Retextion - Subscription Purchased - This metric is triggered by all subscription orders created in Shopify, including checkout subscription orders and recurring subscription orders

Tip! If you would like to build a flow that triggers only for recurring subscription orders, you can achieve that by doing the following:

  1. Use the "Retextion - Subscription Purchased" metric to trigger the recurring subscription order flow

  2. Add a trigger filter "orderNumber is greater than 1". This will exclude the first subscription order (aka the checkout order) from triggering this flow.

  • Retextion - Subscription Canceled - This metric is triggered when a customer cancels their subscription

  • Retextion - Subscription Paused - This metric is triggered when a customer pauses their subscription for any period of time

  • Retextion - Subscription Skipped - This metric is triggered by the 'skip next order' action being taken on the subscription

  • Retextion - Order Upcoming - This metric is triggered 2–5 days leading up to the next order date on a subscription

Note: By default, this metric fires 5 days before the next order.

If you've changed the default 5 days to 2–4 days in the Stay Ai Upcoming Order email setting, this Klaviyo metric will respect that as well.

To change the number of lead-up days, navigate to your Stay Ai app > Notifications > Emails > Upcoming Charge > Notification Cadence

  • Retextion - Billing Attempt Failed - This metric triggers when payments fail billing attempts

  • Retextion - Payment Method Expiring - This metric triggers on the first of the month for payments expiring in the following month. For example, this will fire on January 1st for payments expiring in February

Note: When building a flow off of the Payment Method Expiring metric, please add a flow filter to exclude customers with the stay_inactive is true profile property. This will ensure that customers with only canceled subscriptions will be excluded from the flow.

  • Retextion - Item Out Of Stock - This metric triggers when an item is identified as out of stock on a billing attempt

  • Retextion - Order Partially Fulfilled - This metric triggers when an order respects partial order fulfillment in Stay, and fires an order without items that are currently out of stock

Prepaid Subscription-Specific Metric

  • Retextion - Subscription Expired - This metric triggers when the last order in a prepaid subscription is processed through to Shopify

  • Retextion - First Gift Sent - This metric triggers when the first gift of a prepaid gifted subscription is ordered

  • Retextion - Gift Sent - This metric triggers when a prepaid gifted subscription order is fired

  • Retextion - Last Gift Sent - This metric triggers when the last prepaid order in a gifted subscription is fired

Digital Punch Card-Specific Metrics

  • Retextion - Punch Earned - This metric triggers when a customer earns 1+ punch on their punch card.

    • Additional properties passed with this event:

      • punch_card_date_earned: Date and time that the punch was earned

      • punch_card_issued_date: Date and time that the active punch card was issued to the customer

      • punch_card_punch_number: Last punch issued on the active punch card

      • punch_card_remaining_punches: Remaining punches on the active punch card until the most upcoming reward

      • punch_card_upcoming_reward: Details for the upcoming reward (Free product, discounted order or free order details)

  • Retextion - Award Earned - This metric triggers when a customer earns an award on their punch card

    • Additional properties passed with this event:

      • punch_card_reward_earned: Type of the reward that was earned (Free product, discounted order, free order)

      • punch_card_reward_earned_value: Details of the earned reward (Product/variant information, or discounted/free order details)

  • Retextion - Award Redeemed - This metric triggers when a customer applies an award to their subscription order

    • Additional properties passed with this event:

      • punch_card_reward_redeemed:Type of the reward that was redeemed (Free product, discounted order, free order)

      • punch_card_reward_redeemed_discount_code: Details of the redeemed reward (Product/variant information, or discounted/free order details)

      • punch_card_reward_redeemed_value: Details of the redeemed reward (Product/variant information, or the discount code that was issued)

WinbackEngine-Specific Metrics

  • Retextion - Winback Ready - This metric triggers when Stay's machine learning model has determined that a truly canceled subscriber is ready for winback communication

    • All properties that are passed on the Retextion - Subscription Cancelled metric are passed on Retextion - Winback Ready, including cancellationReasons

    • Additional properties passed on this event:

      • cancelledAt: date and timestamp of the last cancellation event of the subscriber

      • daysSinceCancellation: number of days since the last cancellation

Important! This metric will only fire if you have set up your WinbackEngine in the Stay app > Tools > WinbackEngine. You must set up your time delay range, enable the engine, and click Save.

You must also set up a flow in Klaviyo that is triggered off of the Retextion - Winback Ready metric in order for customers to receive an email. If you would like to get started with Stay's templated Winback flow, reach out to your CSM or OM.

Understanding Stay Profile Properties

The following custom properties are currently available.

  • stay_active & stay_active_subscriber - 'true' if the customer has at least one active subscription; 'false' if the customer only has paused or cancelled subscriptions

  • stay_inactive - 'true' if the customer only has cancelled subscriptions; 'false' if the customer has any paused or active subscriptions

  • stay_paused - 'true' if the customer has at least one paused subscription; 'false' if the customer does not have any paused subscriptions

  • stay_active_subscription_count - count of the customer's active subscriptions

  • stay_active_subscription_variant_ids - the variant IDs of the line items in the customer's active subscriptions

  • stay_cancelled_subscription_count - count of the customer's cancelled subscriptions

  • stay_cancelled_subscription_variant_ids - the variant IDs of the line items in the customer's cancelled subscriptions

  • stay_all_subscriptions - subscription IDs of all the subscriptions the customer has

Note: You can view all subscription profile properties by either navigating to a subscription customer's profile in Klaviyo, as seen in the screenshot example below.

You can also create a segment around profile properties and search for "Stay" when prompted to select the property in the segment-builder.

Creating Klaviyo Email Flows

If you'd like to send any subscription emails through Klaviyo instead of Stay (e.g. subscription creation confirmation, order upcoming, cancellation confirmation, etc.), you will need to create flows in Klaviyo. Each flow will be triggered off of a "Retextion" metric. From there, you can build the email you'd like customers to receive when they enter the flow.

Below is a breakdown of the Klaviyo metric you will use to create various subscription email flows.

Note: The 'Security Code' email in Stay must remain toggled on. This email sends the passwordless login verification code to customers so they can access their subscription portal.

Subscription Email

Klaviyo Metric

Subscription Creation Confirmation

Retextion - Subscription Started

Subscription Order Skipped

Retextion - Subscription Skipped

Subscription Paused Confirmation

Retextion - Subscription Paused

Subscription Cancelation Confirmation

Retextion - Subscription Canceled

Upcoming Charge

Retextion - Order Upcoming

ExperienceEngine Promotion Applied

Retextion - Promotion Applied

Item Out of Stock

Retextion - Item Out of Stock

Order Partially Fulfilled

Retextion - Order Partially Fulfilled

Payment Declined

Retextion - Billing Attempt Failed

Payment Expiring

Retextion - Payment Method Expiring

Prepaid Order Completed

Retextion - Subscription Expired

Digital Punch Card Punch Earned

Retextion - Punch Earned

Digital Punch Card Award Earned

Retextion - Award Earned

Digital Punch Card Award Redeemed

Retextion - Award Redeemed

Note: You’ll need to reach to Klaviyo to request that they mark the appropriate emails in your subscription flows as transactional. This ensures that those transactional emails are still sent to customers that are unsubscribed to marketing emails. Here is a Klaviyo help article on sending transactional emails through flows.

Did this answer your question?