facebookIcon tracking


How to Harness the Awesomeness of Google Tag Manager

Published: September 18, 2014

Author: Leslie To

Let it be known that Google Tag Manager is, in my not-so-humble opinion, one of the best free tools to come about in quite a while. The platform allow marketers to seize control of tag management and become less dependent on developers, and the (not so recent) introduction of auto-event tracking makes the platform truly invaluable.

How Tag Manager Works

how tag manager works

Why Does Auto Event Tracking Make GTM Invaluable?

Why, thank you for asking. Before we touch on why auto event tracking is a game changer, let me briefly explain why event tracking is awesome. One of the big limitations of Google Analytics (classic or universal) is that the code must be re-fired in order for the Analytics server to measure a “hit”. Anything that either pushes a user off the site or an in-page interaction (e.g. a video play or Google Maps interaction) is not automatically captured. We can measure these interactions via Event Tracking. The hardest thing about Event Tracking is that it requires in-page element manipulation so that when a click happens, information about the click is pushed to the Analytics servers. For those of us who don’t write code during our spare time, this can be a little challenging.
To complicate matters, event tracking implementation requires developer time. Every element you want to track has to be manipulated in the back end, which can be both costly and time-consuming. And beyond that, if there are 100 other things in the developer’s queue, especially items that directly impact the end customer, it’s very likely that your event tracking request sits at the bottom of implementation priority list.
Auto event tracking changes all of this. Introduced in October 2013, auto event tracking allows us to implement event tracking directly from the Google Tag Manager platform (no developer time required!). You can say goodbye to the olden days of mass-generating Event Tracking scripts and fussing over commas, brackets, and whether or not your script should be an onClick or onSubmit. You still can, if that’s what floats your boat. My point is, you don’t have to anymore. I can’t promise that this process is any easier, but it certainly is less complicated.
The fact that we are less reliant on developers and can control implementation (and tracking!) gives us so much more control over our own fate. Okay, that might be overstating the fact, but you get my drift. It’s awesome.

Ok, so how does auto event tracking work exactly?

Let me break it down for you.
Step 1: Create an event listener tag.

There should be a bold red button that says NEW in your container. If you click that, there are three options: Tag, Rule, and Macro. Pick Tag.

Hover down to Event Listener and choose one of the following: Link Click, Form Submit, Click Timer, JavaScript Error, and History. For the sake of this example, let’s go with Link Click Listener.

Listener Tag

Add a rule to govern this tag. In my example, I went with All Pages, but if this activity only happens on a subset of pages on your site, write a regular expression to account for those pages. Then hit save.

Important point to remember for later: when this listener is triggered, GTM will trigger an event macro.

Step 2: Create a Google Analytics (classic or universal) Event Tag

Now that you have GTM listening for this activity, you’ll need to create a second tag that will collect the information to push to the Analytics server.

Event track type

Only event category and action are required, so fill those out as you wish. These parameters populate in Analytics, so name your parameters wisely. In my example, I chose:

naming parameters

The {{element}} is a macro, which we will cover in Step 3!

Step 3: Add a Macro to Collect Data

After you’ve set up the container to listen to certain things on your site, you’ll need to create an auto-event variable macro to collect the value of the attributes of the element you were listening to (e.g. if you’re listening for a click, the macro would collect information about that click, like anchor text, destination URL, form type, etc.).

Go back to your container and look for that red NEW button again and this time, select Macro, more specifically the Auto-Event Variable. Simo Ahava has a really great Macro Guide to Google Tag Manager that specifically defines all of these variables so go and check it out if you want to know more about these individual items. I’ll give you a minute to browse.

Once you’ve selected the attribute you want the macro to pull, hit save.

Step 4: Create a firing rule for your Analytics Event Tag

This is where everything comes together.

Tags in GTM only work once a rule is in place. So you’ll need to create a rule that governs when this Analytics event tag should fire (i.e. when it should collect data). An important point to remember is that tags only fire when every condition in your rule is satisfied.

You should specify the event macro (which corresponds with your listener from Step 1) as well as the auto-event variable type (from Step 3). This is because we don’t want the container to fire every time a link is clicked (because that would be ridiculous), but every time a specific link is clicked.

edit rule


In order for tags to fire, they need rules. If you skip Step 4, nothing will work.

Step 5: Save Your Analytics Event Tag

You’re almost there. Once you’ve created both of these tags, you’ll want to create a new version of your container. Why? Creating a version is like creating another draft of your work. Creating these milestones within your container gives you points you can revert back to in case you ever make a mistake.

Once you’ve created a new version of your container, you can publish your container and you should be set to go.

And now, celebrate because you’re done! Just wait 24 hours for that data to populate in Analytics. If nothing shows up in the Events report after 24 hours, use the Debugger in GTM. Just hit Preview (to the left of Create Version) and hit Debug!
Good luck!

25 E Washington Street
Suite 420

Chicago, IL 60602(650) 539-4124


Want to become a client?

Contact Us decorative arrow

Want to join the team?

View Our Openings decorative arrow

Find us on social media.

Press inquiries.

Email Us decorative arrow

Expert insights for your inbox. Subscribe to our content.

Accept No Limits.

Learn more about 3Q/DEPT READ MORE