The more complete information you can gather from a customer’s interaction with your brand, the more you can personalize the outreach. The first time that a customer makes a purchase on your site, you capture their email and phone number. This gives you a greater chance of upselling, cross-selling, and winning the customer back for future purchases – but only if you target them with effective content.
This recipe walks through an effective way to win customers back if they have become inactive, by gathering customer touchpoints from a Shopify store to create a specific customer list in Twilio Engage, and use this audience in email and SMS campaigns in Klaviyo.
We can then go step further, using a computed trait to target customers whose last order was significantly below their average order value.
To accomplish this, we will perform the following steps in Segment:
Set up Shopify as a Segment source
Set up Klaviyo as a Segment destination
Build an inactive user audience based on purchase history
Create an email campaign in Klaviyo
Create a computed trait to refine this audience
Step 1: Set up Shopify as a Segment source
This recipe works for any brand using Shopify or Shopify Plus for their ecommerce checkout. The Shopify by Littledata source allows your brand to easily collect pre-checkout and post-checkout events, and link these to a customer profile in Segment.
The setup for this data source is automatic and takes around 10 minutes to configure.
Once connected to your Segment workspace, you will see a full list of enhanced ecommerce events feeding in.
The user traits and events for purchasing customers include by default the `email` attribute that the Klaviyo destination will need.
To make the audience building possible from day 1 with Segment, you can request a historic order import from Shopify.
Step 2: Set up Klaviyo as a Segment destination
Klaviyo can be used as both a data source and destination in Segment. You need to set up the Klaviyo destination.
Create a private API in Klaviyo to allow access to Klaviyo’s API. Go to the account menu in the bottom left, Integrations page, and then Developer Settings.
Click to Manage API Keys and Create Private API Key.
Copy this API key to the clipboard.
Go to your Segment workspace, Connections, and Add Destination.
Search for Klaviyo, select it and Configure Klaviyo.
Under settings, paste in the private key from Klaviyo.
Tip: Do not enable the `Fallback on Anonymous ID` setting. This will add lots of users without emails to Klaviyo, which cannot be used for email campaigns.
Step 3: Build an inactive user audience based on purchase history
Now you are gathering the accurate order events and revenue in Segment, you can use Engage to build an audience. Twilio Engage is available as an add-on for your Segment workspace.
We’ll start by building our inactive customer audience, including those users that have not made a purchase in the last 45 days. 45 days is an example - you should adjust this based on the buying cycle of your product. Goods like food, consumables, and diapers typically have a shorter time between purchases, whereas luxury and electronics see a longer cycle.
In your Segment workspace, go to the Engage > Audiences page.
Click on CREATE > Audience.
Create the first rule for All users who Performed an Event.
Using the builder, include customers who performed the Order Completed event at least once, with revenue of greater than zero (to exclude free samples / tests).
Then add an AND condition to exclude customers who purchased zero times in the last 45 days.
On the right hand side of the builder, click on Preview to display the number of customers in your audience. Note: you should uncheck the include anonymous users box. As you’ll be using this audience for email, you’ll only be able to send it to known users.
Tip: On the right hand side of the builder, click on Preview to display the number of customers in your audience. Note that by default the include anonymous users will be unchecked to only include known users. Klaviyo only allows audiences with known users (with email addresses).
Your first audience is ready, so click NEXT.
Link this audience to the Klaviyo destination we set up previously.
Now review and create your audience. Name it Inactive Customers - last 45 days.
Note: Don’t worry about the ‘Realtime disabled’ message.
Complete this action by clicking on the button in the bottom right, Create Audience.
Now that your audience has been created, Segment will keep updated with all users that fall within this criteria, and sync the audience with Klaviyo every hour.
Step 4: Create email content in Klaviyo
Now it’s time to create a win-back series to engage the Inactive Customers audience you created in the previous steps.
Klaviyo provides a number of resources and examples to master a winback strategy.
We’ll start by building your email content in the Klaviyo platform:
After logging into Klaviyo, navigate to the Campaigns tab and click on Create Campaign, and choose Email.
Name the campaign Winback Series - Inactive Last 45 Days, and in the Recipients list, choose the audience you created in Segment.
It’s safest to keep on ‘Skip recently emailed profiles’ so these customers don’t get two emails from you in one day.
In the content wizard, build your content (email template) using the platform’s drag-and-drop tool, or text-only.
Lastly, you’ll save your content, review, send or schedule timing based on preference.
Step 5: Create a computed trait to refine an audience in Klaviyo
To go one step further, you might want to target customers whose last order was below their average order value. These customers are not inactive, but are declining in value. Creating such an audience will require a computed trait for average order value, which can be created in Engage.
Click on the Computed Traits tab at the top of page and Create Computed Trait.
Select an Aggregation trait type to average properties across a number of events.
Select an Average aggregation type over the Order Completed event name for the revenue property. You could also use `subtotal` to sum up revenue before tax, shipping, and discounts.
Select 365 days as the time window to make this an annual average.
Click to Preview before clicking Next.
Select the Klaviyo destination with which to share the trait as an Identify call. This means the computed trait will be synced with Klaviyo, and every time the customer buys again, the trait will be recalculated.
Then name the trait Average order value and click to Create the trait. Note: it may take an hour for this trait to calculate and be available in an audience for the next step.
Clone the audience we created in step 3 and add to the current space.
Change the first condition to be users that had at least one order with greater than the average_order_value trait in the last year.
The trait is selected from the dropdown, versus a constant value.
And change the second condition to be users who also had one order with less than the average_order_value trait in the last 45 days.
Repeat Step 4 above to use this audience in Klaviyo.
With this recipe, you accomplished the following:
Used Littledata to streamline Shopify events and send these events to Klaviyo
Used Engage to identify a group of inactive customers to reactivate, in order to increase top-line revenue and increase repeat purchase rate
Created and scheduled automated campaigns in Klaviyo to run systematically and increase efficiency
Created a further audience based on a computed trait
Overall, the goal of a winback strategy is not to reactivate all previous purchased or engaged customers, but those who are more likely to make a bigger purchase both now and in the future. It’s important to learn more about your customers, what offers work, and what draws the best return engagement. By utilizing Segment’s Engage feature to quickly, and continuously, identify inactive customers - or better yet, customers about to fall into inactivity - gives a brand that much power to drive top-line revenue and incremental retention.
Getting started is easy
Start connecting your data with Segment.