Google Tag Manager (GTM) is a free Tag Management system launched in 2012 that allows you to manage and deploy snippets of codes or tracking pixels (commonly known as tags) on your website or mobile app.
Google Tag Manager makes this possible without having to modify your site’s code each time you do so.
Because of this, integrating your site with various tools including Google Analytics, Google Ads and Hotjar is much faster and easier to manage.
Main Google Tag Manager Components
- Tags – Contain the actual code which GTM fires. Tags can be classified in 3 categories:
- built-in tags created by GTM team
- community tags created by third-party vendors
- custom tags which are created by you
- Triggers – A set of rules which specify when a particular tag should fire.
- Variables – Collect and store various information in the dataLayer which can later be used in tags, triggers or other variables. GTM has 2 type of variables:
- built-in variables
- user-defined variables
- Folders – Are used to classify and organize tags, triggers and variables.
- Templates – Intended to create tag and variable templates that you later use and configure when adding tags.
- Workspaces – Allows you to create multiple sets of changes for your container.
Benefits of using Google Tag Manager
You will notice that adding new tracking scripts and other marketing tags takes much less time than adding them manually on the site. (But only after you become familiar with how GTM works and feel relatively OK with using it.)
Other than this, here are other benefits of using Google Tag Manager:
- It’s free – There are a lot of tag management systems but most of them are paid while GTM is free.
- Lots of integrations – At the moment GTM offers 79 built in tags and 83 community templates with the number of integrations growing day by day.
- High flexibility – with so many options available when creating a trigger, you can fire a specific tag on lots of user actions such as:
- viewing a page
- reaching the comment section of a post
- Fast deployment – deployment is as easy as creating a tag and a trigger and clicking the “Publish” button.
- Ease of testing and debugging – With the help of the “Preview and Debug” console, testing and previewing tags and setups is really easy. Very few tag management systems offer this functionality.
- Version control – A new version is created every time you publish new changes in your container. And if you ever want to revert it or go back to a previous version, you can always publish older versions from your GTM.
- Large community – Google Tag Manager has a large community with an official forum and a support section where you can find answers to many questions.
Drawbacks of Using GTM
Although not as many as benefits, there still are some drawbacks of using GTM:
- The need of a developer to add the dataLayer scripts on the site – Although not all websites need the dataLayer added on the site, in some cases in order to send data from the site to GTM, you will have to add the dataLayer script directly on the site and for most website owners, this means working with a developer.
- Relatively high learning curve – If you are a beginner, publishing simple tags will not be that hard but if you want to deploy more advanced tracking and tags, you will have to spend a lot of time reading and testing. Or you can always hire a google tag manager expert to add the tracking or integration on your site.
How to Use Google Tag Manager
Now that you know what Google Tag Manager is and it’s pros and cons, we can go ahead and install it on a site and deploy our first tag.
First thing you need to do when installing GTM is to create a GTM account. For this, go to https://tagmanager.google.com, sign in and click on the “Create Account” button.
In the panel that appeared, give your account a name, choose your country, enter a name for your container (usually the domain name of your website), then choose “Web” as the target platform and click on “Create”.
On the next screen, a pop up with your GTM script will appear and you’ll have to copy the script and paste it in the header of your website, on every page.
How to Install the GTM Script on Your Site
[Note from editor: If you are using the Genesis Framework on WordPress, you don’t need that plugin. See these directions for where to put the script code.]
How to Create and Deploy Tags
After installing the GTM script on the site, we can start creating and deploying tags. In this example, we will deploy the Google Analytics pageview tracking tag.
The first thing to do when creating a Google Analytics tag is ensuring that we have a variable which is storing our Google Analytics settings.
In our case, since we have just created the account, we do not have this variable so we will have to create it.
We do this by going to “Variables” menu, then clicking on the “New” button and from variable type, we choose “Google Analytics Settings” and in the “Tracking field” we add our Google Analytics property id.
After this, we can create the Google Analytics pageview tag. For this, in the “Tags” section of GTM, we need to click on “New” and in the pop up that will appear, we need to give our tag a descriptive name like “GA – Pageview” and choose “Google Analytics: Universal Analytics” as tag type.
Then, from the “Track type” options we select “Page view” and choose the newly created “Google Analytics Settings” as the tag settings.
What Trigger to Choose
As for the trigger, we can use the default “All pages” trigger which will fire our tag on all pages where GTM is installed. Next we click on “Save” and our tag is ready.
We now have a tag in our Google Tag Manager container but it’s not yet firing on the site as we have not published the changes.
As a best practice, before publishing a tag, it is always good to test if it’s firing correctly. We do this by clicking on the “Preview” button to enable the “Preview and Debug” mode.
With the preview and debug mode enabled, every time you go to your website you will see the “Google Tag Manager Preview” console at the bottom of your site. And in it, you will see which tags are firing and which are not.
How to Debug Google Tags That Are Not Firing
If for some reason your tag is not firing, you can click on the tag and see which firing rule was not triggered. And then later debug that trigger.
If the trigger / tag is of high complexity, you can always hire a GTM expert to perform a Google Tag manager audit for you.
After you have ensured that tags are firing correctly, you can go ahead and publish the changes to your live GTM container.
To publish the changes, we need to click on “Submit” button from the top right corner and in the pop up that will appear, we need to click on “Publish”.
After this, the Google Analytics pageview tracking tag which we created will fire on our site. And we will have the basic Google Analytics tracking added on the site.
The process of adding other tags is similar to this one. So you can integrate other tracking tools in the same way.
By doing so, you will spend less time on adding and managing scripts and pixels on your site and in turn will have more time to focus on other things like writing a blog post or promoting your site.
Latest posts by Peter Farrugia (see all)
- What Google Tag Manager Is and How It Can Help Your Website - November 8, 2019