All Collections
Survey campaigns
Transactional generic webhook contact data mapping
Transactional generic webhook contact data mapping
Alex Bitca avatar
Written by Alex Bitca
Updated over a week ago

The transactional generic webhook option gives you the possibility to trigger event-based surveys for other external services that we don't integrate with.

Create a campaign to generate the generic webhook URL

To get started, create a new transactional email or in-app survey campaign from the Campaigns page. Assign a survey template to the campaign and review the other campaign settings to ensure that it will work as expected. However, we will focus mainly on configuring the generic webhook and data mapping.

So, in the Trigger section of your campaign, you will be asked to pick a trigger service for your survey: select "Generic webhook" from the list. A unique webhook URL will be generated. You must add this webhook to the service you want to trigger your surveys. We can't provide a step-by-step guide on the setup, as it's different for each service.

However, keep in mind that not all services offer a feature to perform POST requests to external webhooks. Therefore, if you're unsure, you can contact the service's support team to confirm.

Once you've configured the webhook, in most cases, you should be all set; just make sure that your survey campaign is ON in Retently.

Import data into custom Retently properties

We've developed the Generic Webhook trigger to automatically identify a few main Retently properties, such as email address, first name, last name, company name, or an array of tags. When Retently receives data via a webhook URL, it will first look for the contact data in nested JSON objects, and only if it finds nothing will it look into your parent object.

For example, let's assume that you're sending this requests via the webhook URL:

{
"email": {{email_address}},
"firstName" {{first_name}},
"userData": {
"userEmail": {{email_address}},
"userFirstName": {{first_name}}
}
}

In the example above, Retently would have pulled the email address and first name from the "userData" object, as it has a higher priority. Only if the "userData" object lacked these properties, Retently would have pulled them from the "email" and "firstName" fields from the parent object.

But you might want to import your contacts (when they trigger a survey) with additional properties that you pass via the webhook URL.

To do so, you will need to create a custom property in Retently first, and afterward, when you send data via the Retently webhook URL if any of the properties from the webhook payload matches any of your Retently custom properties, they will be imported along with the contact that has triggered the survey.

Let's assume that you're sending this data via the Retently webhook URL:

{
"email": {{email_address}},
"signUp": {{signup_date}},
"product": {
"name": {{product_name}},
"price": {{product_price}}
}
}

If you want to import the contact's signup date, you will have to create a new custom property in Retently (ideally of a "date" type), and the property name should match exactly the name of the property that you're passing: signUp.

But if you want to import the price of the product, then you will still have to create a custom property in Retently, but the name of the property has to show all the nested JSON objects that lead to that specific property, for example: product.price.

These are the basics of mapping and sending data via a generic webhook URL.

Did this answer your question?