How Link Click Listener and Click Listener work in new Google Tag Manager

How Link Click Listener and Click Listener work in new Google Tag Manager

Previously I have written a post about how Link Click Listener and Click Listener works in Google Tag Manager. That was for using with old version of GTM. The below is how you can implement these two for new Google Tag Manager.

How to implement Link Click Listener and Click Listener in new GTM

I will skip the parts about creating GTM container and such as these are mentioned in my old post. Instead I will just go right to the part where you create these two listeners.

 A few things to note:
  • In new GTM interface, the naming has changed. Rules have been changed to “triggers”,  Macros have been changed to “variables”.
  • New GTM has Enabled Built-In Variables which basically means you now don’t have to manually create Variables (Macros) for GTM Container ID.

GTM Built-In Variables

I think this is cool because it saves a lot of time for me to create these and now I just have to tick/check any Variables I want to implement.

 Here is how you can implement Link Click Listener in new GTM:

Link Click Listener Implementation in new GTM

1. Go to Triggers and click on New Trigger:

2. You will land to a screen as below. Under Choose Event> Select Click.

 3. And then under “Configure Trigger”,  select “Link Click”

4. You can put max.wait time (which means delay link open until all the tags that depend upon this event have fired or the specified timeout has elapsed, whichever comes first)

5. Under “Enable When”, you can use Regular Expression .* to match all pages – which means it will fire on all of your URLs. Or if you don’t want to track inbound links (the link clicks that is happening only within your site) and only want to track outbound links, you can create a rule to say don’t fire when the URL matches your URL (for example, for me, don’t fire if the URL starts with zinkohlaing.com etc)

6. Under “Fire On”, you can again choose to select “All Clicks” or “Some Clicks”. If you choose All Clicks GTM will fire this trigger on every link click happens. Otherwise, it will only fire on selected clicks that you define (for example, you can create a rule saying fire this link click listener on the page where you have outbound links but nowhere else)

7. And then once you click save, it is done. You have set up a trigger to track all link clicks happening on your website.

Click Listener Implementation in new GTM

Similarly to link click listener implementation, implementing click listener follows the same process.

So step 1 and step 2 will be the same as above and in step 3, instead of link click listener, you choose “click listener”.



Then, for “Fire On” rule, the same thing as link click listener, you can either set up the trigger to fire on All Clicks or Some Clicks only.
And here is how the same tag looks like for Link Click Listener Event Tracking.

Note: Before creating this tag, you might want to enable your built-in variables such as Click ID, Click Target etc.

And then “On Fire” rule for this tag, click on “More” and select the trigger you have defined for Link Click Listener above.

The process is similar for Click Listener Event tag as well. Just that you have to change the trigger type to Click Listener Trigger.
So that’s it! This is how you can set up link click listener and click listener for new GTM. Give it a try and leave comments if you have any questions.

Cheers!

Zin Ko

Note: This post also appears on zinkohlaing.blogspot.com.