Transactional surveys are sent when an external event is triggered. In simpler words, when something happens outside of Retently, a survey is triggered.
Retently email and in-app transactional surveys can be triggered by multiple external services.
In this article, we will cover how you can trigger a survey via Shopify.
Set up a Shopify event for your survey campaign
From your Shopify admin, go to Settings > Notifications, and scroll down to the Webhooks section.
Click the Create webhook button. A new window should appear. From the "Event" drop-down menu select the "Order creation" event.
IMPORTANT: Currently, our Shopify integration supports two events (more will be added soon):
"Order creation"
"Order fulfillment"
"Fulfilment creation".
In the “Format” field make sure that “JSON” is selected.
In the “URL” field include the webhook link available in your transactional email campaign’s Trigger section.
Finally, from the “Webhook API version” menu, choose the 2024-10 version, but if it's not available, then choose the version that has the "(Latest)" label.
Finally, save your webhook notification, and from that moment on, every time a new order will be created in your Shopify store, the customer will be imported to Retently and will receive a survey in your transactional email campaign.
Shopify is always releasing updates to their webhooks, so if your Webhook API version is not matching the one in the screenshot above, feel free to select the "Latest" version.
Manage customer properties via Shopify
Using the Shopify integration you can assign and update customer properties every time an event is triggered.
IMPORTANT: Each event returns a different set of properties, and in some cases, certain properties that are returned by one event, will be missing in the other event. For example, the "Order creation" even returns customer tags, but the "Fulfilment creation" event does not include customer tags.
"Order creation" and "Order fulfillment" event properties
By default, the integration will map the following properties:
Email
First name
Last name
Customer tags
Country Code listed in the Shipping address
If needed, an additional set of properties can be assigned to the customer when the "Order creation" event is triggered. All you need to do is to create one or more new properties in Retently (learn how) with the following names:
customer_created_at (this is a "date" property)
orders_count (this is a "number" property)
total_spent (this is a "number" property)
last_product_id (this is a "text" property)
last_product_name (this is a "text" property)
last_order_number (this is a "number" property)
last_order_price (this is a "number" property)
discount_applications (this is a "boolean" property)
discount_codes (this is a "boolean" property)
total_discounts (this is a "number" property)
"Fulfillment creation" event properties
By default, the integration will map the following properties:
Email
If needed, an additional set of properties can be assigned to the customer when the "Fulfillment creation" event is triggered. All you need to do is to create one or more new properties in Retently (learn how) with the following names:
order_id (this is a "text" property)
status (this is a "text" property; refers to the fulfillment status)
created_at (this is a "date" property; refers to the fulfilment date)
tracking_company (this is a "text" property)
tracking_number (this is a "text" property)
last_product_id (this is a "text" property)
last_product_name (this is a "text" property)
discount_applications (this is a "boolean" property)
Create customer property in Retently
Start with creating a customer property in your Retently account, on the "Attributes" page. To create a new one, click the "Create property" button.
A popup will ask you to write the name of the new property (ex: Subscription, Signup date, Product name, etc.) and choose the type of the value that will be stored in the new property.
Retently supports the following four data types:
Text: The value will be stored as regular text.
Number: This property can store only numbers (this data type also supports numbers with decimals).
Collection: You can store an array of keywords (ex: "item 1, item 2, item 2").
When creating the property, make sure that you're giving it the exact id as it is listed in our tutorial (check the previous chapter).
Update the value of an assigned customer property
The values in a property that is already assigned to a customer will be updated automatically the next time your automation will be triggered and the contacts will match the automation rules.
Note: If you want to create more transactional campaigns, you have to add the new webhooks to your Shopify account.
Click here to learn about other trigger services that we’re supporting.