An Insight into Google Tag Manager

by on

filed under

In my quest to learn something new in the digital marketing field, I stumbled upon Google Tag Manager and started exploring this tool. Creating events to track on a website has now become an inevitable part in the life of an internet marketing professional. So what exactly do you understand by a tag? Tags are small bits of website code that enable you to measure traffic, user behavior, conversion patterns and many other customized parameters that may be applicable to your business. Undoubtedly, it is extremely vital to incorporate tags to track certain performance parameters on the site but do you think it’s necessary to have a Tag Manager? Adding tags without appropriate management may lead to complications. Superfluous and erroneous tags may often mar your measurement by contributing to duplication or missing information. Additionally, it may sometimes be time-consuming and may also need you to communicate with your IT-team. However, Google Tag Manager resolves these problems by offering an easy-to-use and free web interface to manage your tags efficiently.

Many of us may be wondering about the actual working of Google Tag Manager. So here it goes in a nutshell- Google Tag Manager keeps track of a set of tags and tag-firing rules that define the instant when those tags were triggered on your site. When a user visits the site, the most up-to-date tag configuration is sent over to the end-user’s browser with instructions for which tags should fire.

With this brief knowledge about Tag Manager, let us now understand the process of actually creating a GTM account and getting started off.

Step 1: Create a Google Tag Manager Account

- Directly head to

- You may directly click on SIGN IN in case you already hold a Google analytics or AdWords account. Alternatively, if you don’t have an existing account, then click on SIGN UP to create a new one.

- Name your account and click Next. Ideally, the name of your account should correspond with your organization name. If you are an agency, avoid using a shared account, and create a new account for each client.

Step 2: Set up your first Container

- Container in Google Tag Manager corresponds to Profile in Google Analytics for those who are familiar with Google Analytics. In simple words, a container is an entity that holds all the tags for a particular website. Ideally, it’s best to name your container after your site name. In line with the above used example, the container can be named as abc. Essentially, a new container must be created for each site that you are handling.

- Expand the Domains section and list out all the domains that this container would sit on. This is an optional step, but comes in handy later when you start to preview and debug your container changes.

- Along with listing the domains, it is also essential to set up an appropriate time zone.

- Next, you will be presented with the JavaScript snippet for your newly created container. Paste this snippet on every page of the domain, and position it just after the opening <body> tag.

Once this is done, it is now time to create tags. There are many categories of tags that are present and the apt one may be chosen by you after considering the objective. Simply click New Tag, select the tag type (for example, Google Analytics) and specify rules for when the tag should fire. Yes, it is really that simple to create a tag!

There are many kinds of events within your web pages that you might want to track, including clicks on particular links, buttons, forms, etc. And to track them, e.g. with a Google Analytics event tracking tag, you will have to identify them somehow. Manually tagging them is one option, however, that may often be cumbersome. Instead, up till now, we’ve relied on custom tags in Tag Manager using jQuery to find and identify elements for tracking. Now, Tag Manager has automated listening for certain kinds of events. Look for these automated tags under Event Listener tag type. Refer to the following snapshot.

- Click Listener listens for any click on the page (on any type of element)

- Form Submit Listener listens for form submissions

- Link Click Listener listens for clicks only on link elements

- Timer Listener fires after a defined interval of time

These tags aren’t Google Analytics tags; you will need a separate tag for GA or other tools where you want to send this data. Instead, these are utility tags that listen for these events and generate data for the page’s data layer, which you can then use in another tag to send the data to a measurement tool.

Let us try and learn the most common Event Listener which is Link Click Listener.

Suppose we have some links or buttons for which we want to capture clicks with event tracking in Google Analytics. Here’s how we’ll go about it.

First, add a tag with type Event Listener > Link Click Listener. Your rule for this tag should be on All Pages. We can later decide links that are of interest to send to GA, but the easiest and most forward-looking way to implement this is to include this code on all pages.

Whenever someone clicks on a link, for Link Click Listener, GTM creates an event in your data layer. The event is called gtm.linkClick for Link Click Listener. We’ll be able to use this in a GTM rule to fire a GA tag in the next step.

Now add a tag with type Google Analytics. Note that this is in addition to the tag you’re already using to track your page-views. This additional tag will track events.

1. Select “Event” as the Track Type. Fill in Category, Action, Label, and Value with the information you’d like to send to your GA Event reports. These simply describe what it is someone is clicking.

2. Create rules to fire this tag. Here, we need to fire the tag when the event gtm.linkClick occurs in the data layer. But it should be borne in mind that this will occur any time any link is clicked. You might want to be more specific. For example, suppose we only wanted to track links to PDFs.

Note that you can create multiple tags with different rules, and different Categories, Actions, Labels, etc. So you might have a tag for PDF tracking, as above, and another tag with a rule only for links with a class of “button”, that each fire different events. Here are some example rule ideas to get you started:

  1. File types: {{event}} equals gtm.linkClick and {{Auto Event URL}} ends with .pdf (or .doc, or .mp3, or whatever)
  2. Outbound links: {{event}} equals gtm.linkClick and {{Auto Event URL}} starts with http:// and {{Auto Event URL}} does not contain
  3. Buttons: {{event}} equals gtm.linkClick and {{Auto Event Class}} contains button.
    Make sure under “More Settings” for this GA tag that you’ve matched the settings on your page tracking tag. As with all GTM changes, you’ll want to create a new version, preview it on your site to make sure it’s working correctly, and finally publish it live.

Many a times, we may come across a scenario where we have such buttons to track on 100 different pages of our site. Now how do we tackle that?

Well, GTM provides an easy solution to this as well. Read on to find the answer -

- Create a tag to Listen for All Link Clicks

- Setup this tag to fire on any link clicks in addition to, when the element URL matches your conditions. Here, the condition was that the URL would contain ‘request-info’.

- Make your next rule that targets the APPLY button in a similar manner.

- Now add your Google Analytics Event tag in the following manner.

- In a similar manner edit the tag to set up a rule for the APPLY button.

And after this is done, you will be able to see your desired results in Google Analytics (Behavior > Events)

Here is a snapshot of how it will appear in GA.

Like I mentioned earlier, you will now have to create a new version in GTM, preview it and finally publish it to see it live.

Hope this blog post helps you understand how to setup tagging using Google Tag Manager, and if required, how to link it to Google Analytics. Please post your questions and feedback in the comments below.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>