The Shopify + Iterable integration, automatically imports customer, event, and product data from your Shopify store into your Iterable project. With this data, you can create journeys that automatically:
Welcome new users
Re-engage users who've abandoned their browsing session
Encourage users with items in their cart to complete their purchase
Send order confirmation messages
Send shipment and delivery updates
Update a user's phone number
Update a user's SMS marketing preferences
In this article
- Welcoming new users
- Re-engaging users who've abandoned their browsing session
- Encouraging users with items in their cart to complete their purchase
- Sending order confirmation messages
- Sending shipment and delivery updates
- Updating a user's phone number
- Updating a user's SMS marketing preferences
- Learn more
Welcoming new users
When a new user is created in Shopify, Shopify populates the shopify_created_at
field with the date and time (in ISO 8601 format).
This field is added to all Iterable user profiles that are synced with the
Shopify integration.
You can create a welcome journey and set it up to add users to the journey when
their shopify_created_at
user profile field is first populated in Iterable.
Here's how:
Create a new journey, and double-click the Start tile to open its settings menu.
Set the entry source to User Profile Update, and select the
shopify_created_at
user profile field from the dropdown.Under Additional Entry Rules, click Add Rule.
-
Set up a rule with the following conditions:
- Must have All of the following:
shopify_created_at
≥ now-10m
This rule requires users to have been created within the last 10 minutes, which prevents existing users (with older
shopify_created_at
dates) from being added to the journey and receiving a welcome message. - Must have All of the following:
Set the Maximum Entries to 1 (since users should only receive the welcome message once).
Add a Time Delay tile and connect it to the Start tile.
Set the delay to 10 Minutes.
Add an Email tile, and connect it to the Time Delay tile.
Set up the Email tile to send your brand's welcome campaign.
When you're finished, the journey should look something like this:
Re-engaging users who've abandoned their browsing session
Sometimes, users will start looking at an item and then abandon their browsing
session. The productView
custom event gives you information about the item
the user viewed:
{ "userId": "123456789123456", "email": "user@example.com", "eventName": "productView", "dataFields": { "product_id": "234567891234", "name": "Grantham Leather Chaise Lounge", "handle": "grantham-leather-chaise-lounge", "description": "Meet the new centerpiece of your living room. Lovingly crafted in vegan leather, the Grantham chaise provides the perfect mix of style and comfort. This Calvin & Maya exclusive has been a customer favorite for over a decade.", "categories": [ "grantham", "leather", "chaise" ], "image_url": "https://cdn.shopify.com/s/files/1/1811/2875/products/granthamLthrChaiseEspSHS15_16x9_a52b33ce-e225-4ebc-82a8-512169715b8a_1024x1024@2x.jpg?v=1488408793", "url": "https://calvinandmaya.com/collections/chaise-lounge-sofas/products/grantham-ii-leather-chaise-lounge", "vendor": "Calvin & Maya", "product_type": "Chaise Lounge", "tags": [ "grantham", "leather", "chaise" ], "inventory_management": "shopify", "inventory_quantity": 18, "inventory_policy": "continue", "price": "2499.00", "compare_at_price": "2899.00" } }
You can set up a journey that encourages users to pick up where they left off and hopefully take the next step towards purchasing the product they've previously viewed. Here's how:
Create a new journey, and double-click the Start tile to open its settings menu.
Set the entry source to Event Occurs > Custom Event, and select the
productView
event from the dropdown.Add a Time Delay tile and connect it to the Start tile.
Set the delay to 30 Minutes.
To avoid over-messaging users, it's a good idea to set up some checks before sending a reminder to reinitate a browsing session. Add a Yes/No Split tile, and connect it to the Time Delay tile.
Double-click the Yes/No Split tile to open its settings menu.
-
Set up a query that checks whether the user has shown further intent to convert in the last 3 days by doing any of the following:
- Updating their cart
- Starting a checkout session
- Completing a purchase
Leave the Yes branch unconnected — that way, if the user has performed any of these actions, they exit the journey.
Add another Yes/No Split tile and connect it to the No branch of the previous one.
Double-click the Yes/No Split tile to open its settings menu.
-
Set up a query that checks whether the user has received a browsing session abandonment message in the last 2 weeks.
-
Add a message tile, and set it up to send your browsing session abandonment campaign.
When you're finished, the journey should look something like this:
Encouraging users with items in their cart to complete their purchase
Sometimes users add an item to their cart but don't complete the checkout process. You can set up a cart abandonment journey that sends a friendly reminder to users who previously showed intent to purchase but may need a little extra nudge. Here's how:
Create a new journey, and double-click the Start tile to open its settings menu.
Set the entry source to Event Occurs > Shopping Cart Update.
Add a Time Delay tile and connect it to the Start tile.
Set the delay to 30 Minutes.
To avoid over-messaging users, it's a good idea to set up some checks before sending the reminder to complete the checkout process. Add a Yes/No Split tile, and connect it to the Time Delay tile.
Double-click the Yes/No Split tile to open its settings menu.
-
Set up a query that checks that the user:
- Has not made a purchase in the last 30 minutes
- Still has items in their cart
Leave the Yes branch unconnected — that way, if the user has already completed their purchase or has removed the item(s) from their cart, they exit the journey.
Add a message tile, and connect it to the No branch of the Yes/No Split tile.
-
Set up the message tile to send your cart abandonment campaign.
When you're finished, the journey should look something like this:
Sending order confirmation messages
An important part of every e-commerce transaction is letting the customer know that their order is confirmed. You can use an Iterable journey to do this automatically. (Shopify can also do this, but you can disable Shopify's transactional email sends if you prefer.)
Here's how to set up an order confirmation journey in Iterable:
Create a new journey, and double-click the Start tile to open its settings menu.
Set the entry source to Event Occurs > Purchase.
-
Purchase events from the Shopify integration contain a data field called
update
.update
isfalse
when the purchase is first tracked, but is set totrue
for any subsequent updates to that purchase. Since we only want users to go through the order confirmation journey once for each purchase event, we'll set up an entry rule that only allows users to enter the journey when the initial purchase event occurs. Under Additional Entry Rules, click Add Rule.NOTE
Wondering why a purchase event would be updated? Purchases are commonly updated throughout the shipping process. For example, an update might occur when a shipping label is printed, or when the item is shipped, out for delivery, or delivered. Shopify communicates these order updates via the integration, and the associated purchase event is updated in Iterable.
-
Set up a rule with the following conditions:
- Must have All of the following
update
= false
- Must have All of the following
Add a message tile, and set it up to send your brand's order confirmation campaign.
When you're finished, the journey should look something like this:
Sending shipment and delivery updates
After a customer makes a purchase, the order fulfillment process begins. You can use an Iterable journey to communicate shipment and delivery status updates at every step.
When an order is placed in your Shopify store, the Shopify + Iterable
integration sends a createFulfillment
event. Afterwards, the integration
tracks the following events for fulfillment status updates:
Event name | Explanation |
---|---|
label_printed | A label for the shipment was purchased and printed. |
label_purchased | A label for the shipment was purchased, but not printed. |
attempted_delivery | Delivery of the shipment was attempted, but unable to be completed. |
ready_for_pickup | The shipment is ready for pickup at a shipping depot. |
confirmed | The carrier is aware of the shipment, but hasn't received it yet. |
in_transit | The shipment is being transported between shipping facilities on the way to its destination. |
out_for_delivery | The shipment is being delivered to its final destination. |
delivered | The shipment was successfully delivered. |
failure | Something went wrong when pulling tracking information for the shipment (for example, the tracking number was invalid or the shipment was canceled). |
While it's possible to trigger journeys from these specific events, it's easier
to track the changes with the original ("parent") resource — the
createFulfillment
event, which is updated each time an order status changes.
This example uses the createFulfillment.shipment_status
field to let a
customer know when their order has been shipped, but you can expand the journey
to update customers about many of the other statuses. For example, you could
send a message when the order is out for delivery or has been delivered.
NOTE
The implementation of this journey may vary, depending on which fulfillment
processors you've integrated with. (This can affect what data is available in
the createFulfillment
event.)
Create a new journey, and double-click the Start tile to open its settings menu.
Set the entry source to Event Occurs > Custom Cvent.
Select the
createFulfillment
event from the dropdown.Under Additional Entry Rules, click Add Rule.
-
Set up a rule with the following conditions:
- Must have All of the following:
createFulfillment.shipment
=in_transit
- Must have All of the following:
Fulfillment events can be updated many times with the same status (like "in transit" each time the shipment arrives at a different carrier facility), so it's a good idea to make sure you haven't already sent the user a shipping confirmation message about this particular order. To do this, add a Yes/No Split tile and connect it to the Start tile.
-
Set up a query that checks whether the
order_id
for this order is already listed in the values for thein_transit_order_ids
user profile field:- Find contacts that meet All of the following clauses:
- Contact Property
- Where
in_transit_order_ids
Contains{{order_id}}
- Find contacts that meet All of the following clauses:
Add a User Profile tile, and connect it to the No branch of the Yes/No Split tile.
Select the Use the Data Below option.
-
Add the following JSON in the text entry box:
{ "in_transit_order_ids":"{{#assign \"dupe_order_id_check\"}}{{order_id}},{{/assign}}{{#ifContainsStr in_transit_order_ids dupe_order_id_check}}{{in_transit_order_ids}}{{else}}{{#if in_transit_order_ids}}{{#assign \"output\"}}{{in_transit_order_ids}}{{order_id}},{{/assign}}{{else}}{{#if order_id}}{{#assign \"output\"}}{{order_id}},{{/assign}}{{else}}{{#assign \"output\"}}{{/assign}}{{/if}}{{/if}}{{/ifContainsStr}}{{output}}" }
This code does a few things:
-
Checks to see if the
order_id
from the event already exists in thein_transit_order_ids
string.If so, it sets the
in_transit_order_ids
to itself (in other words, does nothing)If not, it goes on to the next step.
-
Checks to see if the
in_transit_order_ids
variable already exists or if this is the first occurrence of the event.If it already exists, it adds the current
order_id
to thein_transit_order_ids
string, followed by a,
.If it doesn’t exist, it sets the
in_transit_order_ids
to the currentorder_id
, followed by a,
.
Assigns the newly created string to
in_transit_order_ids
.
Here's how the output will look on the user's profile:
-
Add a message tile, and connect it to the User Profile tile.
-
Set up the message tile to send your shipping notification campaign. You can use data from the
createFulfillment
event to populate the template with the details of the user's purchase.
When you're finished, the journey should look something like this:
in_transit_order_ids
user profile field
Managing the It's a good idea to create a separate "cleanup" journey that removes the
order_id
from the in_transit_order_ids
user profile field when an order has
been delivered or has failed to be delivered. Here's how:
Create a new journey, and double-click the Start tile to open its settings menu.
Set the entry source to Event Occurs > Custom Event.
Select the
createFulfillment
event from the dropdown.Under Additional Entry Rules, click Add Rule.
-
Set up a rule with the following conditions:
- Must have Any of the following:
createFulfillment.shipment_status
=delivered
- Or
createFulfillment.shipment_status
=failure
- Must have Any of the following:
Add a User Profile tile, and connect it to the Start tile.
In the User Profile tile, select the Use the Data Below option.
-
Add the following JSON in the text entry box:
{ "in_transit_order_ids":"{{#assign \"order_id_to_remove\"}}{{order_id}},{{/assign}}{{cut in_transit_order_ids order_id_to_remove}}" }
This uses the Handlebars
cut
helper to remove theorder_id
from the string.
Updating a user's phone number
Shopify stores a customer's phone number in the phone_number
field. You can
use a journey to write the value of phone_number
to Iterable's phoneNumber
user profile field. Here's how:
Create a new journey, and double-click the Start tile to open its settings menu.
Set the entry source to Event Occurs > User Profile Update.
Select the
phone_number
field from the dropdown.Add a User Profile tile, and connect it to the Start tile.
Select the Use the Data Below option.
-
Add the following JSON in the text entry box:
{ "phoneNumber":"{{phone_number}}" }
When you're finished, the journey should look like this:
Updating a user's SMS marketing preferences
The Shopify integration tracks a user's SMS marketing consent status in the
sms_marketing_consent
field, which looks like this:
"sms_marketing_consent": { "state": "subscribed", "opt_in_level": "single_opt_in", "consent_updated_at": "2021-08-03T15:31:06-04:00", "consent_collected_from": "OTHER" }
The state
field can be one of the following values:
State | Value |
---|---|
not_subscribed | The customer hasn't opted in to SMS marketing. |
pending | The customer is in the process of opting in to SMS marketing. |
redacted | The customer's personal data has been erased. (This value is internally-set and read-only.) |
subscribed | The customer has opted in to SMS marketing. |
unsubscribed | The customer was previously opted in to SMS marketing but isn't anymore. |
You can use this information to set up a journey that subscribes users to Iterable's SMS message type when they opt in to receive SMS messages in your Shopify store. You can also unsubscribe users from this message type if they haven't yet consented to SMS marketing or have opted out. Here's how:
Create a new journey, and double-click the Start tile to open its settings menu.
Set the entry source to Event Occurs > User Profile Update.
Select the
sms_marketing_consent
field from the dropdown.Add a Yes/No Split tile, and connect it to the Start tile.
-
Set up a query that checks whether the user's SMS marketing consent status is
subscribed
:- Find contacts that meet All of the following clauses:
- Contact Property
- Where sms_marketing_consent.status =
subscribed
- Find contacts that meet All of the following clauses:
Add a Subscription Preferences tile and connect it to the Yes branch of the Yes/No Split tile.
-
Set the Subscription Preferences tile settings to the following:
- Subscribe Contacts To
- Default SMS Message Type
Add another Yes/No Split tile and connect it to the No branch of the previous one.
-
Set up a query that checks whether the user's SMS marketing consent status is
redacted
,unsubscribed
, ornot_subscribed
:- Find contacts that meet Any of the following clauses:
- Contact Property
- Where sms_marketing_consent.status =
redacted
- Or
- Contact Property
- Where sms_marketing_consent.status =
unsubscribed
- Or
- Contact Property
- Where sms_marketing_consent.status =
not_subscribed
- Find contacts that meet Any of the following clauses:
Add a Subscription Preferences tile and connect it to the Yes branch of the Yes/No Split tile.
-
Set the Subscription Preferences tile settings to the following:
- Unsubscribe Contacts From
- Default SMS Message Type
When you're finished, the journey should look something like this:
Learn more
For a full list of the events that can be synced from Shopify to Iterable with this integration, see Shopify + Iterable Integration.