+91 9580 740 740 WhatsApp

What Is Google Tag Manager & How to Use It

In today’s world, tools optimize performance and enhance businesses digitally. The Google Tag Manager is a user-friendly solution for managing the tags, or the snippets of JavaScript that send information to third parties on websites or mobile apps. Adding other products to your site includes but is not limited to AdWords Conversion Tracking and Remarketing, DoubleClick Floodlight, and GTM. It makes your life easier by simplifying the process of adding these JavaScript snippets to your website. Instead of updating code on your website, you use the interface to decide what needs to be fired and on what page or action, and then add appropriate tracking to your site which makes sure it all works.


A guide to Google tag manager


Google Tag Manager is a tag management system (TMS) that allows you to update measurement codes and related code fragments collectively known as tags on your website or mobile app quickly and easily. Tags are custom or templated codes that you add and edit snippets to a website.


Google Tag Manager is a tag management system that includes the same functionality as global site tags that works in unison with another piece of code, an event snippet, or a phone snippet, to track your conversions. Tags can add analytics tracking, manage advertising pixels, or create additional site functionality while tracking website conversions whereas the event snippet tells the global site tag when to track a conversion.


Suppose you’re tracking calls to your website; the phone snippet replaces your business phone number with a Google forwarding number. When you set up conversion tracking for your website, you’ll be able to view and copy the global site tag for your account and any snippets that should be used with the tag.


The code snippets that you find below are just examples and won’t work on your website. It lets you configure and deploy tags on your website or mobile app instantly from a convenient web-based user interface.


Tag Manager features include support for tag organization and version control, 3rd party and community-developed tag templates, and enterprise collaboration and security features. Tag Manager helps to optimize tag deployment. It reduces tag configuration errors and allows you to modify and deploy tags on your site instantly from a web-based interface.


The Google Tag Manager Consists of Three Main Parts:


  • A snippet of code (usually JavaScript) is added to a page.
  • Triggers that define when and where tags are executed.
  • Variables to receive or store information to be used by tags and triggers.


Components of Google Tag Manager


Before you start working with the tag manager you need to know the following concepts


  • Containers

 You will need to create a container to work with GTM which essentially “holds” all the tags for your site. After which GTM gives you some code to add to your site, your container code and it will be added to the source code so it displays on each page of your site. Some CMS, such as WordPress, have plugins to help add the container code but you may need to contact your web developer to have it added. Then you’ll be able to add, edit, disable, or remove your tags as needed through GTM.


  • Triggers

Each tag on a site needs to serve a specific purpose, say you want to have a tag send information when someone downloads a file, when an outbound link is clicked, or when a form is submitted. These events are known as triggers. All tags need to have at least one trigger assigned to them. Triggers can be broken down into two major components: events and filters. When you configure a trigger in GTM, there’s a long list of types of triggers to choose from. These are your events. After choosing your event you’ll be able to set up your filter.


Filters are further divided into three parts: variables, operators, and values. The operator tells the tag whether an event needs to equal, greater, or less than, a certain value, contain a certain value, etc. The value is the condition that needs to be met. A value doesn’t necessarily mean a numerical value. In many cases, your value maybe something like a URL or a keyword.


For example, if I wanted to see how many people were reading the blog content on my site in-depth, I could create a tag with a Scroll Depth event trigger that will fire when the vertical scroll depth reaches 75%. If I want it to fire on every page of my site, then I leave the “All Pages” option selected in the trigger configuration box.


If needed, I can create further filters. But since I’m focusing on blog content on my website, I chose “Some Pages” and created the filter “Page URL” “Contains” and “fakewebsitename.com/blog.”


Sometimes you wouldn’t want a tag to fire, so you can create a blocking trigger that prevents it from firing on those occasions. GTM prioritizes these blocking triggers over other types of triggers. Suppose you have a blocking trigger that contradicts a condition set by another trigger.


Google Tag Manager will follow what’s been specified by the blocking trigger. If you have a tag that’s set to fire on all of your pages but would want to exclude a few pages from that, you can just use a blocking trigger to prevent it from firing on those few pages you don’t want to fire on.


  • Variables & Constants

Tags depend on triggers, and triggers depend on variables. Variables contain the value a trigger needs to evaluate to know whether it should or should not fire. The tag, on the other hand, compares the value of the variable to the value defined in the trigger and if the variable meets the conditions of the trigger, the tag will fire.


Tags also use variables to collect information that can be passed onto the data layer as a user interacts with the site, i.e., a tag is set to fire when a person adds a certain number of products to their shopping cart, Variables can be reused between tags. A tip while using GTM is to create constant variables with ID numbers or tracking codes you’ll need to use more than once.


For example, if you’ll need to use your Google Analytics property ID number in multiple tags, then you can just create a constant string variable with the value being your ID number. That way, instead of repeatedly looking up and entering your ID number, you could just select the variable name.


You’ll be working with two different types of variables while using GTM: built-in variables and user-defined variables. Built-in variables most commonly used types of variables, so Google made them easy to access in GTM. After selecting a built-in variable, you can configure its settings however you’d like.


These are just a few of the built-in variables for regular web containers, and you can find more built-in variables by clicking the “Configure” button. There are different options to choose from if you’re using GTM for AMP sites or mobile apps. You can create a user-defined variable if you need another type of variable that’s not included as a built-in variable.


You’ll be given a list of types of variables to choose from when you go to add a user-defined variable. Simo Ahava has a very useful guide to different variable types with more information on each type of variable. By clicking on the “Variable” option on the left-side menu, variables can be created from the GTM dashboard. It can also be created while you’re creating a tag by clicking on the button next to the field that looks like a Lego block with a plus sign on it.


You may also want to know about Google Trends


  • Data Layers

Tags are informed whether or not they should fire, but how (or where) do they get that information? One way they find it is by checking the page’s HTML structure, but that’s not an ideal solution as it can take longer for them to fire, if the HTML structure of the site changes over time, tags can break.


Besides, there are certain types of information a tag might need that’s not found in a page’s HTML, like a transaction total. A data layer is a JavaScript object that keeps the information tags needed separate from the rest of your site’s code as tags don’t have to spend time searching through the HTML to find the information they need.


This is another way GTM helps improve site speed. Everything they’re looking for is possibly found in one place and readily available when the page loads. You don’t have to specifically define the data layer yourself, GTM can initiate one for you. Technically, data layers are optional but if you want to use GTM to track specific events, you’ll need to have a data layer.


The object needs to be placed before the GTM container code when adding a data layer. GTM won’t be able to access the information in it and the data layer will reset after loading if the data layer object is placed after the container code. The brackets in the second line can be populated with information, variables, and events once the data layer object has been added to a page’s code.


Some types of information can be written directly into the data layer, but others can be pushed into the data layer dynamically as a user interacts with your site, like if someone downloads a file or if they add a certain amount of products to their shopping cart.


Working With GTM


Go to tagmanager.google.com and create an account.  Enter the name of the company whose site is being managed under “Setup Account,” and hit “Continue.”


01 Creating a GTM Account.png


Next, to set up your container enter your domain name as the container name, choose which type of page or app it will be used on, and click “Create.”, You’ll have to specify whether you’re using Firebase SDK or a legacy SDK if you choose iOS or Android.


02 Setup Container.png


Use the company name as the account name and the site’s domain for the container name or you can name this anything you want. This is the best practice recommended by Google. Generally speaking,  while working with GTM is make sure everything is named very clearly, it’s very easy for mistakes to be made.


Google advises creating one container per domain than having multiple GTM accounts that can be managed within a single GTM account.  All tags can all be placed within one container and there is no need to create separate containers for each tag or every individual page on a site.


But if a company has subsidiaries or owns separate businesses, the website for each subsidiary/business should get its container and all the containers that can be managed from one main GTM account. The subdomain should also be given its container if a site has a subdomain that is treated separately from the main domain.


When a company has a marketing agency managing tags on behalf of a company, the company should create its GTM account, and then add the agency’s Google account as a user. It’s easy for the company to revoke access should they decide to change agencies but the agency can access GTM this way. Then accept the GTM terms of service and you’ll be given your container code.


Recommended Read: Business Accounting and Taxation Courses in India


03 GTM Container Code.png


After adding the container code you’re able to start creating tags. Before which you take some time to figure out exactly which tags you want to add, keep the number of tags you use to a minimum for best performances. Review the tags currently on your site if you’re migrating your tags to GTM from another tag manager or are making the switch from tags coded in your source code. This is a good opportunity to “clean house” the tags that are associated with services they’re no longer using or were used to track things that aren’t being monitored anymore.


Creating a Tag

The first thing you’ll see is the GTM dashboard while creating or selecting a container. Click “Add a New Tag” to open up a window to name and configure your tag.


04 GTM Dashboard.png


Name your tags very clearly as sites often use several different tags, you won’t want there to be any confusion about which tag does what. The tag naming convention recommended is Tag Type – Detail – Location. For example, a GA tag that tracks form submissions on a Contact Us page would be named “GA – Form Submission – Contact Us.” 


including location helps distinguish it from similar tags on other pages. If there are other GA form submission tags on my site, specifying this one is on the Contact Us page would help me avoid editing the wrong one by mistake.


Putting tag type at the beginning of a tag name also helps keep your tags more organized. GTM organizes tags alphabetically, so if you create several tags for the same service or tool, they will all be grouped and easy to find.


Now, let’s get back to making a tag. With this click “Add a new tag” on the dashboard and select “Tag Configuration,” you’ll be presented with a long list of tag templates that include many of the most commonly used types of tags. Click on what you’re looking for and fill out the form.


If the type of tag you want to create isn’t listed, select “Custom HTML” to enter your custom. For example, if I wanted to notify Google Analytics anytime someone views my pricing page after choosing Universal Analytics, this will appear


Recommended Read: Financial Modeling Courses in India


05 GA Pricing Page Tag Configuration Example.jpg


Then choose “Page View” from the “Track Type” dropdown menu, and enter the variable with my Google Analytics account information. If that variable was not created ahead of time, do now by clicking the dropdown menu under “Google Analytics Settings” and choosing “New Variable.”


To make changes to the tag firing sequence or create a firing schedule, click on the “Advanced Settings” option then click outside the tag configuration window to go back to the previous screen. Next, create at least one trigger by clicking the “Triggering” box underneath “Tag Configuration” to get started.


If a trigger is not created earlier to choose from in the list that opens up, click the + sign in the upper right corner of the window, a new window where you’ll be asked to name your new trigger opens, then click on the “Tag Configuration” box to see a list of trigger types and choose “Page View” or your choice.


06 Remarketing Trigger Configuration Example.jpg


If you want the tag to fire on one page, choose “Some Page Views.” Create a filter specifying the page URL needs to equal the URL of my pricing page. TO add another filter, click the plus (+) button next to the filter to set one up.


To create multiple filters for this tag and later decided to get rid of one of them, hit the subtract (–) button next to the filter in question, and click outside the window to exit. Once the tag and trigger have been configured, save it, keep working by creating more tags or you can preview your tag and make sure it’s working correctly before publishing it.


Additional Resources


Google Tag Manager has a lot to offer. Learning how to use it in depth can be overwhelming. This guide introduces you to the tool, but there’s a lot more to learn to use GTM to its full potential. LunaMetrics and Simo Ahava have written about GTM and are excellent places to start if you have any questions or want to learn more.


Even if you’re not a developer, Google’s Tag Manager Guide for Developers does a great job explaining some of the concepts related to GTM and has a lot of information about how to use it. There are also a lot of crash courses offered by institutes if you want to master it and all the very best to you to make the best out of google tag manager.




1. When should I use Google Tag Manager?

Google Tag Manager helps you increase your agility. You can add and update the tags for tracking the conversions, site analytics, and more. There are numerous ways to track your activities on your site and apps and you can accordingly make changes to the tags. 


2. Is Google tag manager Free?

Google Tag Manager has multiple features including not limited to usability itself but also accounts and user roles, tag firing rules, and supported tags (Google, third-party, and custom HTML tags) that are free and user friendly.


3. Can you do it yourself?

Yes, insert the container tag once, and make changes whenever you want without much hassle with the available debugging tools and preview mode before you publish it.


4. Are there limitations?

You can use Google Tag Manager truly unlimited. with more than just Google products such as Marin, comScore, AdRoll, and more! Can’t find the tag you need? Customize and add Tag Manager to not only your website but also to your iOS and Android devices.


5. What are the Features Of Google Analytics?

Google Tag Manager makes it easier to implement some of the more complicated Google Analytics features, such as User ID tracking which gives you the ability to measure real users, instead of devices. This provides more accurate data, which ultimately helps your users. Tag Manager also helps with common challenges faced in Google Analytics, like Custom Dimensions, Cross-Domain Tracking for multiple sites that are tracked together in Google Analytics, and Enhanced Ecommerce which requires collaboration with developers.


6. Can we easily track more?

With the availability of so many great resources on the web (and our site!), it’s easier than ever to track the YouTube videos on your site, print tracking, or AJAX form submissions.



Google Tag Manager has all of the security features with two-factor authentication that requires both your normal password and then a numeric code that you receive via a text message, voice call, or mobile app. You can also control the access by granting different levels of permission both in the account and container levels.

Leave a Reply

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


Call Us