You can connect a Retently survey campaign to a Segment event and send and deliver an email or in-app survey whenever that event is triggered in Segment.
Create a transactional campaign in Retently
Start with creating a new survey campaign in your Retently account. On the Campaigns page, follow these steps:
Click the "Create new campaign" button.
Choose your campaign's main metric (e.g., NPS, CSAT, CES, etc.). The score generated by this metric will be displayed on the Dashboard and as the main score in your campaign reports.
Next, choose email or in-app as your survey channel.
Finally, choose "transactional" as the campaign type.
Note: If you plan to deliver in-app surveys after building the campaign, make sure to install the in-app script in your web application. Learn more.
Shortly you will be redirected to the campaign editor, where you will see multiple sections you can navigate through and make adjustments.
Template section
The first one is the “Template” section, where you have to assign the survey template that will be delivered to your contacts. You can choose an existing template or create a new one.
Audience section
As a general rule, your campaign audience will be defined by the Segment event, and only the contacts that trigger the event will be surveyed in this campaign.
However, you can apply an additional layer of filters to narrow down your audience (only in email transactional campaigns).
Suppose you have a Segment event fired when the contact places an order in your online store. You can pass contact properties to Retently, and in the Audience section, you filter your contacts based on a particular property, such as "Country is USA", for instance.
In most cases, there is no need to adjust the audience filters at all. But, if you have to, we recommend checking our article to learn more about the audience segmentation in campaigns.
Note: There are no audience filters in transactional in-app campaigns as you filter your audience and decide who should receive the survey when you configure the survey’s trigger event in the external service. So, the survey campaign will survey all contacts reaching your campaign.
Trigger section
In the Trigger section, choose "Segment" from the "Survey triggered via" menu. This will generate a webhook URL you will need later when configuring your Segment event.
Next, you have a few other options that will help you configure how and when your surveys will be delivered to your contacts:
Survey time frame: By default, a contact will be able to see the in-app survey on any day and at any time of the day. However, if you want to deliver the survey on particular weekdays and within a narrower time range, you can choose the "Deliver within a specific time frame" option and adjust the settings. Learn more about the "Time frame" options.
Survey audience sampling: By default, the campaign will survey all contacts that have triggered the survey. However, if needed, you can choose to survey only a subset of your contacts, for example, deliver only 50% of the triggered surveys.
Survey delay: With the default settings, the in-app survey will be scheduled to be delivered as soon as the user logs into their account in your web application. But you can activate the delay option so that the surveys are scheduled to be delivered at a later date from the triggered event.
Survey throttle: This option helps you avoid over-surveying your contacts. You can also choose whether the throttling algorithm should take into account only the surveys that contacts receive in this campaign or all campaigns. Learn more about survey throttling.
Survey daily limit: If needed, you can limit the number of surveys the campaign will deliver per day. The surveys that were scheduled for today but did not fit the daily limit will be queued and delivered the next day (or the next available day).
Reminder section
Reminders will help increase your survey response rate. For instance, if a contact doesn't respond to your survey within three days after opening it, our system will send them a reminder email survey. This way, you will be reaching your contacts once more when they might be more likely to answer the survey.
Moreover, you can choose a different survey template for your reminders, with different wording or style, that might be more appealing to your survey respondents. You can create a new email survey template in the Templates section of your campaign or on the Templates page.
Alerts section
Create custom alerts and keep track of survey responses. When creating a new alert, you will be asked to choose one or more events you want to be notified about, the alert frequency (immediately, daily, or as a weekly digest), and the notification channel (email or Slack).
Autoreplies section
Create a set of email autoreplies to engage with contacts who did not leave any text feedback, left a Detractor score, or simply ask Promoters to leave their reviews on specific platforms and spread word-of-mouth. Autoreplies will be sent to respondents with a random delay between 5 and 60 minutes from when they've answered the survey.
Export section
Retently allows you to connect to other services and have your survey data exported there and added to your contacts' profiles in those services. When connecting a service and creating a new export, you will have the possibility to choose what data you want to export.
In this section, you can also create exports via webhooks. Moreover, you can build a custom request and choose the exact format of the exported data.
Analytics section
When this option is active, your survey responses with text comments will be automatically analyzed by an AI algorithm and classified into topics.
Misc section
Here you will find additional general settings, such as deactivating the CAPTCHA verification or survey respondent location tracking.
Configure a webhook destination in Segment
In your Segment account, follow the tutorial below:
Add a Webhook destination
Access the Source that will eventually trigger the survey. On the Source's page, click the "Add destination" button to open a new Catalog page.
On the Catalog page, search for the "Webhooks (Actions)" destination and add it.
Now, on the Source page, you should see the new Webhooks destination. Click on it to access the Webhooks editor.
Map the data
Go to the "Mapping" section and click the "+ New mapping" button.
In the mapping editor, you will need to select the event that will trigger the survey.
Next, click the "Load test event from source" button to pull some test data that you will need in a few moments when configuring what data will be sent to Retently.
Now, in the "3. Select mappings" section, in the first field, you have to add the Retently webhook URL that you have generated in the campaign's Trigger section.
After you've added the webhook URL, skip all the other fields in this section until you find the [Select object | Edit object] toggle menu, and click the "Edit object" option.
Next, in the "Select event variable" field, start with choosing an email variable (from your Segment source) that should be the email address of the contact that will be eventually surveyed. In the "Enter key name" field, simply type: email.
The email is the only mandatory field that you need to map to ensure that your transactional surveys will work. However, you can pass other variables as well, and they will be added as contact's properties in Retently. To add a new field, click the "+Add mapping field" button. Retently allows you to map the following default properties as key names:
first_name
last_name
company
tags
Map custom Retently properties
Additionally to the default properties, you can create custom properties in Retently and map them as keys in your webhook mapping.
Create a custom property in Retently
You can create a new custom property in Retently on the Contact Attributes page.
Click the "Create property" button and in the popup, give the property a name and choose its type (make sure the type matches to the data that you will send to this property from Segment).
After creating the property, you can go back to your segment account and click the "+Add mapping field" button. Choose another variable that you want to map to the new Retently property, and in the key field, insert the Retently property name.
Important: The Retently property name in the key field should be written in lowercase, and spaces should be replaced with underscores. Below I will list a few examples with Retently property names and what their key names should be:
Name: Subscription (key: subscription)
Name: Subscription Name (key: subscription_name)
Name: This Is A Custom Prop (key: this_is_a_custom_prop)
Finish webhook setup
Now you can send a test event. Please remember that this will result in a survey sent to the contact from the Segment data sample.
When everything looks ok, you can save the mapping and enable it.
Also, make sure that the Webhook destination is also active on the Settings page.
From now on, every time the Segment event is fired, a survey will be triggered in Retently.