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

fire on

Creating a trigger while creating a new tag

Moreclick 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 an ‘Create trigger’ dialog box through which you can select trigger type: ‘click’ or ‘link click’:

create trigger

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:

trigger link click

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

 

form trigger2

When you click on the ‘Form’ trigger button, you see a ‘Create trigger’ dialog box:

form trigger

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:

form fire on

url contains /shop/men/checkout

 

 

 

 

 

 

 

 

 

 

Take the Course

Most Popular E-Books from OptimizeSmart

Learn to read e-commerce reports book banner

Check out my best selling books on Web Analytics and Conversion Optimization on Amazon

How to get lot more useful information?

I share lot more useful information on Web Analytics and Google Analytics on LinkedIn then I can via any other medium. So there is really an incentive for you, to follow me there.

Himanshu Sharma

Certified web analyst and founder of OptimizeSmart.com

My name is Himanshu Sharma and I help businesses find and fix their Google Analytics and conversion issues. If you have any questions or comments please contact me.

  • Over twelve years' experience in SEO, PPC and web analytics
  • Google Analytics certified
  • Google AdWords certified
  • Nominated for Digital Analytics Association Award for Excellence
  • Bachelors degree in Internet Science
  • Founder of OptimizeSmart.com and EventEducation.com

I am also the author of four books:

error: Alert: Content is protected !!