Skip to main content
Transactional survey trigger via Gorgias
Alex Bitca avatar
Written by Alex Bitca
Updated over a year ago

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 Gorgias.

Set up Gorgias HTTP integration to trigger your survey in Retently

Gorgias HTTP integrations let you notify external systems about a ticket's status change. In our case, we will create an HTTP integration containing the Retently webhook link (that you can copy from the "Trigger" section of a transactional survey campaign). Therefore, whenever an event is triggered, the notification will go through the webhook link and trigger the transactional survey in Retently.

To create a new HTTP integration, you will need to access the Settings area in your Gorgias workspace.

Next, access the Integrations category, find the "HTTP" integration option, and access it.

Note: If you've connected Gorgias export according to the instructions from this article, the Webhook will already be there called "Gorgias: send transactional email survey".

On the HTTP page, click the "Add HTTP integration" button.

In the integration builder, give it a name and description (optional).

Next, configure the rest of the fields as described below:

  • Triggers: Choose the "Ticket updated" trigger.

  • URL: Add the Retently webhook link from the campaign's Trigger or Setup sections. Learn how.

  • HTTP Method: Choose "POST".

  • Request content type: Choose "application/json".

  • Response content type: Choose "application/json".

  • Headers: No need to add any headers.

  • Request Body (JSON): Choose "JSON template".

Basically, your setup should look like this:

The next part is important as it's related to choosing what contact data you will send to Retently when a ticket is updated. We will cover this in the next chapter.

Manage contact properties

When you've selected "JSON template" in the Request body field, an additional text input has appeared.

In this area, you have to specify what data will be sent to Retently when your Gorgias trigger is activated.

By default, Retently will accept the following data:

  • Contact's email address

  • Contact's full name

  • Ticket tags (which will be assigned as contact tags in Retently)

To pass this data to Retently, make sure the text area looks like this (you can copy the JSON code below):

{
"email": "{{ticket.customer.email}}",
"full_name": "{{ticket.customer.name}}",
"tags": "{{ticket.tags}}"
}

However, there's a set of other properties that you can import to Retently along with your contact when a ticket is updated, specifically:

  • Source

  • Ticket ID

  • Customer ID

  • Assignee Name

  • Assignee Email

  • Ticket Channel

  • Ticket Subject

  • Ticket Created Time

If you need to send one or more of these properties to Retently, you will need to create them in Retently first, based on the instructions below:

In your Retently account, access 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 and choose the type of the value that will be stored in the new property. Use the property names and property types as follows:

  • source (property type: text)

  • ticket_id (property type: text)

  • customer_id (property type: text)

  • assignee_name (property type: text)

  • assignee_email (property type: text)

  • ticket_channel (property type: text)

  • ticket_subject (property type: text)

  • ticket_status (property type: text)ticket_snooze_date

  • ticket_snooze_date (property type: date)

  • ticket_created_time (property type: date)

After you have created the property or properties, you can go back to your Gorgias HTTP integration, and add the new properties in the Request body field. Each property should have a corresponding Gorgias variable assigned. You can copy the whole JSON with variables (or only the needed properties) here:

{
"email": "{{ticket.customer.email}}",
"full_name": "{{ticket.customer.name}}",
"tags": "{{ticket.tags}}",
"source": "Gorgias",
"ticket_id": "{{ticket.id}}",
"ticket_status": "{{ticket.status}}",
"customer_id": "{{ticket.customer.id}}",
"assignee_name": "{{ticket.assignee_user.name}}",
"assignee_email": "{{ticket.assignee_user.email}}",
"ticket_channel": "{{ticket.channel}}",
"ticket_subject": "{{ticket.subject}}",
"ticket_snooze_date": "{{ticket.snooze_datetime}}",
"ticket_created_time": "{{ticket.created_datetime}}"
}

Note: From the properties listed above, only the email address is mandatory. The other properties are optional and you can delete them from the text area if needed.

Finally, save your Gorgias HTTP integration, and click the "Activate (or Re-activate) integration" button to start tracking ticket updates and trigger surveys in Retently.

Assign a property to a customer


Every time the "Ticket update" trigger will be fired, the contact will be added as a new contact in your Retently account, and the properties from the JSON field will be assigned, along with the values from the specified Gorgias placeholders.


Update the value of an assigned customer property

The values in a property that is already assigned to a contact will be updated automatically the next time your integration will be triggered.


Unassign customer property

Every time an automated rule is triggered, the contact's properties will be updated with the new values that will be sent via the Retently webhook. However, if no value is available for a particular property, then the property will be unassigned from the contact's record in Retently.

Avoid over surveying

This whole setup will basically send an email survey to a contact every time their ticket in Gorgias is created or updated, and this might result in a lot of surveys being sent to the same contact.

In order to avoid over-surveying your audience, you can apply any of the suggestions listed next in the article.

Use one trigger at a time

At the moment of writing this article, Gorgias gives you the possibility to select up to three triggers in an HTTP integration.

The problem is that simple things might fire multiple triggers. For example, creating a new ticket would also fire the "Ticket updated" event.

Basically, a single event would fire the Retently webhook link two or three times, which would result in the customer receiving multiple surveys at the same time.

To avoid this, we suggest activating only one trigger, for example, only when the ticket is updated.

Activate the survey throttling

However, if you need to have multiple triggers activated, then we suggest activating the throttle option within your Retently campaign's Trigger section.

The throttle will ensure that a customer is surveyed only once within a specific time range. Basically, even if multiple triggers are fired, only the first one will trigger the survey in Retently, while the other ones will be dismissed.

Track the ticket status

Even though Gorgias allows you to track whenever a ticket is updated, it lacks any further filters that would help you narrow down these events.

In the case of CX surveys, usually, you'd need to send a survey when the ticket is closed. To achieve this, you will need to make sure to pass the "{{ticket.status}}" property with your Gorgias HTTP request and if your workflow requires you to snooze tickets (in Gorgias a snooze is equated to a close) then you will need to pass on the "{{ticket.snooze_datetime}}" property as well.

This will give you the possibility to filter your campaign's audience by adding an extra layer of rules: ticket_status -> is -> closed and ticket_snooze_date-> does not exist.

You can also trigger the survey when a specific tag is assigned to the ticket. For example, you can create a new ticket tag in Gorgias, "survey" and add it to a ticket when you need to trigger the survey. To make sure that in Retently only contacts with the "survey" tag will receive a survey, go to your campaign's Audience section and add the following audience rule: Customer Tag > is > survey.

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

Did this answer your question?