Understanding Triggers in Google Tag Manager
Trigger Events
A trigger event is one of the conditions when the trigger should fire/execute. Following are the various events when a trigger can be fired:
#1 Pageview – fire the trigger on pageview
#2 Click – fire the trigger when a click event occurs.
#3 Form – fire the trigger when the form submit event occurs.
#4 History Change – fire the trigger when the user’s current browser history changes.
#5 Custom Event – fire the trigger when the custom event occurs.
#6 JavaScript Error – fire the trigger when a javascript error occurs.
#7 Timer – fire the trigger after a given interval.
In GTM v2, triggers have been made an integral part of a tag creation process, so you can not create a tag without first creating the corresponding trigger.
There are two methods of creating a trigger in GTM v2: one is while you are creating a new tag and one is through the triggers menu.
More – click on this button to select an existing trigger or to create and select a new trigger.
Click Trigger
When you click on the ‘Click’ trigger button, you see a ‘Create trigger’ dialog box through which you can select trigger type: ‘click’ or ‘link click’:
If you select ‘Click’ from the drop-down menu, your tag can fire on any click on your website, no matter which element a user clicks on. If you select ‘Link Click’ from the drop-down menu, your tag will fire only on clicks on a link(s).
Once you have selected ‘Link Click’ as trigger type, you will see additional fields: ‘Wait for Tag‘, ‘Check for validation‘ and additional filter field:
Select the checkbox ‘wait for tags‘ to delay the opening of the links until all dependent tags have fired or specified time (i.e. max wait time) has elapsed, whichever comes first.
Select the checkbox ‘Check Validation‘ if you want the tag to fire only when the link has actually being clicked i.e. the click on the link takes a user to another page.
You also need to set up filters to specify when your link click trigger should fire. For example, I want to fire a tag on the page whose URL contains ‘/shop/men/shirts/’ and when the ‘Click ID’ is ‘smshrt’. That’s why I set up the following filters:
url contains /shop/men/shirts
Click ID equals smshrt
Form Trigger
When you click on the ‘Form’ trigger button, you see a ‘Create trigger’ dialog box:
If you select ‘All Forms’, your tag will fire on submit event for any form.
If you select ‘Some Forms’, your tag will fire on submit event but only for selected forms. While configuring your ‘Form’ trigger you get the option to select ‘wait for tags‘ and ‘check validation‘.
Select the checkbox ‘wait for tags‘ to delay the form submit until all dependent tags have fired or specified time (i.e. max wait time) has elapsed, whichever comes first.
Select the checkbox ‘Check Validation‘ if you want the tag to fire only when the form is successfully submitted. If you keep this checkbox unselected then the tag may fire even when a user is just trying to submit the form.
You also need to set up filters to specify when your form trigger should fire. For example, I want to fire a tag on the page whose URL contains ‘/shop/men/checkout’ because this page contains my form. That’s why I set-up the following filter:
url contains /shop/men/checkout
Trigger Events
A trigger event is one of the conditions when the trigger should fire/execute. Following are the various events when a trigger can be fired:
#1 Pageview – fire the trigger on pageview
#2 Click – fire the trigger when a click event occurs.
#3 Form – fire the trigger when the form submit event occurs.
#4 History Change – fire the trigger when the user’s current browser history changes.
#5 Custom Event – fire the trigger when the custom event occurs.
#6 JavaScript Error – fire the trigger when a javascript error occurs.
#7 Timer – fire the trigger after a given interval.
In GTM v2, triggers have been made an integral part of a tag creation process, so you can not create a tag without first creating the corresponding trigger.
There are two methods of creating a trigger in GTM v2: one is while you are creating a new tag and one is through the triggers menu.
More – click on this button to select an existing trigger or to create and select a new trigger.
Click Trigger
When you click on the ‘Click’ trigger button, you see a ‘Create trigger’ dialog box through which you can select trigger type: ‘click’ or ‘link click’:
If you select ‘Click’ from the drop-down menu, your tag can fire on any click on your website, no matter which element a user clicks on. If you select ‘Link Click’ from the drop-down menu, your tag will fire only on clicks on a link(s).
Once you have selected ‘Link Click’ as trigger type, you will see additional fields: ‘Wait for Tag‘, ‘Check for validation‘ and additional filter field:
Select the checkbox ‘wait for tags‘ to delay the opening of the links until all dependent tags have fired or specified time (i.e. max wait time) has elapsed, whichever comes first.
Select the checkbox ‘Check Validation‘ if you want the tag to fire only when the link has actually being clicked i.e. the click on the link takes a user to another page.
You also need to set up filters to specify when your link click trigger should fire. For example, I want to fire a tag on the page whose URL contains ‘/shop/men/shirts/’ and when the ‘Click ID’ is ‘smshrt’. That’s why I set up the following filters:
url contains /shop/men/shirts
Click ID equals smshrt
Form Trigger
When you click on the ‘Form’ trigger button, you see a ‘Create trigger’ dialog box:
If you select ‘All Forms’, your tag will fire on submit event for any form.
If you select ‘Some Forms’, your tag will fire on submit event but only for selected forms. While configuring your ‘Form’ trigger you get the option to select ‘wait for tags‘ and ‘check validation‘.
Select the checkbox ‘wait for tags‘ to delay the form submit until all dependent tags have fired or specified time (i.e. max wait time) has elapsed, whichever comes first.
Select the checkbox ‘Check Validation‘ if you want the tag to fire only when the form is successfully submitted. If you keep this checkbox unselected then the tag may fire even when a user is just trying to submit the form.
You also need to set up filters to specify when your form trigger should fire. For example, I want to fire a tag on the page whose URL contains ‘/shop/men/checkout’ because this page contains my form. That’s why I set-up the following filter:
url contains /shop/men/checkout
My best selling books on Digital Analytics and Conversion Optimization
Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.
Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.
Attribution Modelling in Google Analytics and BeyondSECOND EDITION OUT NOW!
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.
Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.