Skip to main content
All CollectionsWebsite surveysTrigger website surveys with Google Tag Manager
Trigger an event-based website survey in Google Tag Manager
Trigger an event-based website survey in Google Tag Manager

Use GTM to control Survicate surveys on your website

Agnieszka avatar
Written by Agnieszka
Updated today

Website or in-product surveys can be installed on your website in various methods, one of which is Google Tag Manager.

If you're using Google Tag Manager on your website, you can also trigger surveys with this tool, to keep all your code in one place.

Setting up your survey to pop up after a website user triggers a specific event allows you to:

  • target users that added a specific product to their basket,

  • show a survey just as a user cancels their subscription,

  • add a specific button in the navigation of your product to let the user decide when he wants to leave feedback.

In this article, we'll guide you step-by-step through using GTM to trigger a website survey after an event.

Please note that this feature is available on some of our subscription plans. Reach out to us at support@survicate.com to learn more about the pricing.

Install Survicate on your website

We described how to add the Survicate tracking code via GTM to your website in this guide.

Please follow the steps outlined there, and then you'll be able to continue setting up the event trigger.

Add a new GTM tag with the event

To trigger a survey after an event occurs on your website, you should pass the information about the event to Survicate.

To do this:

1. Create a new HTML tag in Google Tag Manager, which will serve as the trigger you want to use to show the survey.

2. In this new tag, select Custom HTML as the Tag Configuration:

and include the code that will include the name of the event, as well as, optionally, its properties:

<script>
if (window._sva) {
window._sva.invokeEvent('myCustomGTMEvent', {a: "1", b: "2"})
}
</script>

❗️ Event properties should be string values.

More information about the invokeEvent method can be found in our documentation for developers.

3. The GTM tag with the invokeEvent code should be triggered in Google Tag Manager by any trigger (Custom Event) of your choice that you have coded beforehand, such as cart_abandonement, subscription_canceled, button_clicked, and so on:

Remember to trigger this event after the tag with Survicate tracking code is initialized.

Then, the Survicate tracking code will be initialized first, and after that when the trigger happens on your website, the event-based survey will appear to the visitor.

Set up the targeting in your survey

1. Head over to the Target > Triggers tab of your Website or in-product survey.

2. Under the option, When would you like to show the survey? select When a user triggers an event.

3. Here, type your event name; you can also add event properties, as well as target your survey even more precisely by applying event targeting filters.

4. You can also  specify the property name and value, time delay after event occurrence, number of event occurrences, time of the first occurrence, and time of the last occurrence of the event after which you'd like the survey to appear to a website visitor.

❗️ If you apply more than one filter to the event, all of the applied conditions should be met for the survey to appear.

If you choose to + Add another event to the targeting, the survey will appear if the visitor triggers one of the events:

📞 If you have any questions about triggering a survey with Google Tag Manager, please reach out to us at support@survicate.com or strike up a chat conversation 👉

Did this answer your question?