Skip to main content

Transactional survey trigger via generic webhook

Use the Generic Webhook trigger to send transactional surveys from any service that can post a JSON payload, including in-house and proprietary platforms Retently does not integrate with directly.

Written by Alex Bitca

🗒️ Contents:


Transactional surveys are sent when an external event is triggered. In simpler words, when something happens outside of Retently, a survey is triggered.

Retently integrates directly with a number of services (Zapier, Zendesk, Freshdesk, Salesforce, HubSpot, Shopify, Chargebee, Gorgias, and others), but we cannot build a dedicated integration for every tool that exists. This is especially true for in-house and proprietary platforms.

The "Generic Webhook" trigger solves that. It is a universal trigger: as long as the other service can send a JSON payload containing at least the survey respondent's email address, you can use it to trigger surveys in Retently, with no dedicated integration required.

How it works

  1. You create a transactional survey campaign in Retently and set its trigger to "Generic Webhook".

  2. Retently generates a webhook URL that is unique to that campaign.

  3. You configure the other service to send a POST request with a JSON payload to that URL whenever the event you care about occurs.

  4. Each time Retently receives a request on that URL, it creates or updates the contact from the payload and sends them the survey from that campaign.

Set up the campaign

To get started, create the survey campaign:

  1. Go to the Campaigns page and click the "+ Create new campaign" button;

  2. Choose a survey metric for this campaign (e.g., NPS, CSAT, CES);

  3. Choose your survey channel: "Email" or "In-app";

  4. Choose "Transactional" as the campaign type. Only transactional campaigns can be triggered by an external event.

You will be redirected to the campaign's edit mode, where you can configure the campaign as you would any other transactional campaign: assign a survey template, review the audience, and set up reminders, alerts, autoreplies, analytics, and webhooks. These options work exactly the same way regardless of which trigger you use.

Choose the Generic Webhook trigger

The part that matters for this setup is the "Trigger" section of the campaign.

In the "Survey trigger method" block, open the "Survey triggered via" menu and select "Generic Webhook". A webhook URL is generated automatically and displayed right below, along with a "Copy link" option.

The URL looks like this:

https://wh.retently.com/generic/{{unique_id}}

The same URL, together with setup instructions and a sample payload, is also available in the campaign's "Guide" section.

📌 IMPORTANT: The webhook URL is unique to this campaign. A webhook can be assigned to only one campaign, and a campaign can have only one webhook assigned.

The URL is the only credential: anyone holding it can create contacts and trigger surveys in your account. Share it only with the service that needs it. If it is ever exposed, you can regenerate it from the Inbound Webhooks page and re-assign it to your survey campaign, and then delete the old one.

Add the webhook to the other service

Copy the webhook URL and add it in the service where your event happens, as the destination of a POST request.

Every service configures this differently, and we can't provide a step-by-step guide for each one. Look for a feature named webhooks, outbound webhooks, HTTP request, or automations in the other service's settings.

📝 NOTE: Not every service can send POST requests to an external URL. If you're unsure whether yours can, contact that service's support team to confirm.

Once the webhook is configured on their side, switch your campaign ON in Retently. If the campaign is off, incoming requests will not send surveys.

The JSON payload

The payload must contain at least the respondent's email address. Retently also recognizes the contact's first name, last name, company name, and tags, and can map any additional values in the payload onto your custom properties.

A minimal payload looks like this:

{
"email": "customer@example.com",
"first_name": "Jane",
"last_name": "Doe",
"company": "Example Inc",
"tags": "vip, renewed"
}

The full payload structure, the rules for nested JSON objects, and how to map data to custom properties are covered in a dedicated article:

A successful response from the webhook URL confirms that Retently received the request, not that a survey was sent. The payload is processed afterward, and the survey can still be skipped if the email address is missing or misspelled in the payload, the contact doesn't match the campaign's audience filters, the contact was recently surveyed and the throttle applies, or the contact is unsubscribed or suppressed.

When the other service cannot send webhooks

If the service where your event happens cannot post to an external URL, or you need to reshape the data before Retently receives it, use an intermediary automation platform to bridge the two. Tools like Zapier and Make can listen for the event in one service and send the JSON payload to your Retently webhook URL.

Click here to learn about other trigger services that we're supporting.

Did this answer your question?