Google Tag Manager: Part 3 – Events

By Jay Adamsson

Adding event tracking to Google Analytics is the next step beyond basic tracking, and is pretty much mandatory before doing any significant business or operational analysis on your website.  So, armed with the basic ideas behind Google Tag Manger and the first steps in implementing Google Tag Manager, we can now turn our attention to tracking events.

A Google Analytics event is still the same as it always has been.  It has the same components of Category, Action, Label, and Value.  What is different is how events are sent to Google Analytics when using Tag Manager.

As an example, the home page of the Analytic-OR website has a link to download our e-book, Take Control: Strategic Websites for Non-Profits.  Clicking this link takes the user to a download page, so an obvious measure is how often this link is clicked, which helps determine if home page is encouraging users to download the book.  With the basic Google Analytics tracking, the number of times users visit the download page can be determined, but how often do they click from the home page to this download page?  This is a perfect place to use an event.

Under the old Google Analytics, you would put some extra code in the HTML of the page, specifying that an event is to be created when the link is clicked.  With Tag Manger, the philosophy is a bit different, and requires two steps.  First, you tell Tag Manager to listen for a click.  Then, you tell it what to do when it hears a click.

Step 1: Create The Listener

In Google Tag Manger, click New -> Tag.


We’re going to create a tag listener only for the home page.  Give the listener a name (such as “Home Page Link Click Listener”).  Now the tag type has to be selected.  In the pop-up menu, choose Event Listener -> Link Click Listener.  You’ll note that there are four options under Event Listener.  The Click Listener will listen for any clicks on page, and is useful if your needs do not fall in any of the other categories.  The Form Submit Listener is used when a form on the page is submitted.  The Link Click Listener is in cases such as this one, where we want to keep track of someone clicking on a HTML link.  Finally, the Timer Listener is triggered at some regular interval.


We are going to use this listener only on the home page, so we need to define a firing rule that will only activate on this one page.  Click the Add button next to Firing Rules, and choose to Create New Rule.  Name the rule something like “Home Page Only”, then create the condition “{{url}} equals”.  The first part of this condition, “{{url}}” is a macro that returns the URL of the page, so this condition only lets the tag fire on the home page.

Step 2: Create the Event

We now have set up Tag Manager to listen for the page link click.  Next, we have to tell Tag Manager to actually create the event.  For this, we need to create another tag.  Select New -> Tag to create this new tag, and give it a name, such as “Home Page Book Click”.  We want this to send an event to Google Analytics, so choose this as the Tag Type, and enter your UA-XXXXXX-XX Google Analytics ID into the next box.  Under Track Type, choose “Event”, and new enter your event characteristics.  For this example, we’ve chosen a category of “Home Page”, an action of “Download” and a Label of “Non-Profits Book”.


At this point, we’ve told Tag Manger that we want to trigger this event, but we have yet to say when the event should be created.  This is where we have to tie the two tags together through the rules.

The first tag we created fires when a link is clicked on the home page.  When this happens, Tag Manager actually creates a Google Tag Manger event named gtm.linkClick.  What we need this tag to do is create the Google Analytics event every time this Google Tag Manger event is generated.  Add a firing rule here, and add the condition “{{event}} contains gtm.linkClick”.  But at this point, this GA event will be created every time someone clicks on a link on the home page, whether or not it is clicking through to the book download page.  So we need to add a second condition to only generate the event for clicking through to the book.  Add a second condition that says “{{element url}} contains take-control-strategic-websites” (or whatever is appropriate for your situation.  Now, the event will only be created from the home page, and whenever the destination URL contains those specific words.


Finally, don’t forget to create a new version and publish your new tags.