Google Tag Manager and how to use it. The basics.

Have you ever wondered what Google Tag Manager (GTM) is? Does it seem complex to you? Did you notice that the new Google Analytics script references tag manager?

There are 2 main components we are going to talk about. The first is tags and the second is triggers. In the image below, we are looking at the tags section of one of my website GTM accounts. You will notice in the third column, is the ‘Firing Triggers’ column. In order for a tag to be used, it has to be triggered by some sort of event.

Google Tag Manager tags
Tags page of our GTM account.

What is a tag?

A tag is basically HTML or javascript you execute when the trigger happens. If you have ever had to add tracking code, or some sort of code to the footer of every page, once you have Google Tag Manager installed you can add it from there. The upside of using GTM is you can see what tags get fired when instead of having it hidden throughout your code.

If you have ever ran ads either on Google Adwords or Facebook, you know you need to add pixels and conversion tracking to help track how well your ads perform. Depending on the complexity of your setup, this could be achieved with no coding on your end.

What is a trigger?

A trigger is an ‘event’ that happens, and when it happens it will load a tag. Google Tag Manager comes with a ‘All Pages – Page View’ trigger out of the box. This trigger is used whenever you need some tag to fire on every single page.

You can have all sorts of triggers, such as form submissions, clicks to certain elements or links, custom events you send yourself, even timers that fire every so often.

In the image below, we have defined 2 triggers. The first trigger happens when our form with and id of “registerform” is submitted. The second trigger is a page view but when the URL is specifically our registration page. When each of these triggers are true, they each fire a tag.

Google Analytics Triggers
Google Analytics Triggers Page

Below we can see what tags the triggers fire. The ‘Facebook Pixel ViewContent’ tag is fired for the ‘Registration Page View’ trigger. As mentioned above, this trigger happens when you land on the page with ‘/register’ in the URL. Next we see the ‘GA – Register Form’ tag is fired when the ‘Register Form Submission’ trigger is used.

GTM Tag Example
Example Tags

Why use Google Tag Manager

If you are uncomfortable with editing your website, Google Tag Manager gives you an easy way to add some integrations. If you pay a company to manage your website for you, this allows you to add those integrations without having to pay a fee for a simple “add this script here” request. You can do it yourself, or have a whiz staff member do it.

Once you understand the concepts between tags, triggers, data layers and what not, you can unlock a lot of tools and not have to worry about code or updating your website.

What I use Google Tag Manager for

I use Google Tag Manager for some basic things. On TodoSage.com for example, here is what I use:

  1. Google Analytics
  2. Sending events to Google Analytics I want to track (see the register form submission trigger above)
  3. Facebook Pixel and ad tracking
  4. Hot Jar heatmap tracking

Most of these are simple embed scripts on every page and they ‘just work’. When you are just starting out, you don’t have to go crazy with your implementation. Start small and add more over time if you need to.

It’s best to only add things you need and are going to use. If you have noticed all those “we use cookie” banners, those happened because of websites doing all sorts of tracking of you that you don’t know about. It resulted in countries finally taking issue with it and demanding more transparency.