Quickly and easily update and manage tags and code snippets on your website or mobile apps, or, in this case, your Segmanta surveys using Google's Tag Management system.
💡 This article covers
- How to integrate a Segmanta survey with Google Tag Manager (GTM)
- How to label a survey for use as a Data Layer Variable in GTM
- How to set up triggers based on Data Layer Variables in GTM
Integrating a Segmanta survey with Google Tag Manager (GTM)
- Navigate to the Integrations tab of the Configure menu.
- Click + Add on the Google Tag Manager integration.
- Visit your Google Tag Manager account and copy your Google Tag Manager container ID.
- Click here for a deeper dive on the GTM Container ID.
- Paste the Container ID in the field.
You will now be able to add scripts and events to the survey using your Google Tag Manager dashboard.
Pro-tip: You can also add a GTM Container ID on the account level to streamline your survey level integrations.
Note:
Google Tag Manager is available under Advanced & Enterprise plans only. For more information, send us an email.
By setting up a GTM integration, you are responsible for any data passed to Google Tag Manager or any applications integrated via GTM.
Labeling a survey for use as a Data Layer Variable in GTM
💪 When to use it
- You can integrate your GTM Container ID with a Segmanta survey and deploy pixels across your survey immediately. However, if you'd like to use GTM to fire more specific events based on survey events, you will need to use information passed via the data layer as your GTM triggers.
🔨 How it works
- After setting up the basic GTM integration on your survey, you can begin labeling your survey for use as a Data Layer Variable. Here’s how to do that:
- Visit your Segmanta survey > Configure > Integrations.
- Select Google Tag Manager.
- Add a label for each event that you want to send to GTM. You will need to utilize these labels when setting up Data Layer Variables in GTM.
Setting up triggers based on Data Layer Variables in GTM
- Visit your GTM account and click Triggers > New.
- Name your trigger.
- Click Trigger Configuration.
- Select Custom Event.
- Paste or type the relevant Event Name.
There are four possible Event Names. Make sure that you copy & paste or type the event name exactly as listed below.
page-viewed
page-answered
ending-reached
ending-link-clicked
At this point, you can choose to save your trigger. The trigger will fire every time any "Event Name" fires from Segmanta on any survey where you have a GTM container integration. Or most often, you will want to customize the trigger further by following the steps below:
- Select Some Custom Events.
- Open the Click Text dropdown menu and select New Variable from the bottom of the list.
- Click Variable Configuration.
- Select Data Layer Variable.
- Under the Data Layer Variable Name field, insert the relevant Data Layer Variable Name.
Here is the default information used to define custom labels that you can insert in your Google Tag Manager Integration on the survey level.
This default information will be necessary to set up any data layer variables for Segmanta surveys. Make sure that you copy & paste or type the name exactly as it appears in the article.
Event Name
page-viewed
page-answered
ending-reached
Ending-link-clicked
Data Layer Variable Name
survey_public_id: the ID that is displayed on your live survey URL
page: associated with a page label
variant: associated with a variant label
question: associated with a question label
subject: associated with a subject label (such as a choice grid subject, question group etc.)
item: associated with an answer choice (such as multi-choice, ranking)
rank: the position an item was ranked in a ranking question
value: the number an item was rated
position: the position text was submitted in a list question
ending: an ending page label
link_button: the link button on an ending page
- Name your variable something you can recognize for use in future triggers.
Pro-tip: Once you have set up a Data Layer Variable Name for the relevant Segmanta event, you will be able to select this Data Layer Variable in your Custom Events dropdown for future triggers. You do not need to recreate a new Variable if you are using the same Segmanta event. For example: once you have created "survey_public_id" variable one time, you can select this from the dropdown menu rather than creating it again.
- Click Save.
- Choose the relevant condition such as "Equals".
- Type the value for the condition. This should match the same exact label that you inserted in your Segmanta Integration Manager for the event. Make sure that you insert the label exactly as you typed it in your Segmanta Editor.
- Click Save. Your trigger is now ready for use with any tag in your GTM.