Google Tag Manager Tutorial 2022 with FREE PDF E-Book

Last Updated: August 20, 2022

What is Google Tag Manager?

Google Tag Manager (also known as GTM) is a free tag management solution provided by Google. Through this online tool, you can deploy and manage various marketing and analytics tags on a website or mobile app.

What is the difference between Google Tag Manager and Google Analytics?

Google Analytics and Google Tag Manager are not really the one and the same thing.

GTM is a tag management tool. Whereas Google Analytics is a website/mobile app tracking tool.

‘GTM’ is primarily used to route data from one data source to another (like from your website to Google Analytics or from your website to a data warehouse). It is not a data source in itself. Whereas Google Analytics is a data source in itself.

gtm tutorial difference 1

gtm tutorial difference 2

Google Tag Manager is a tag management tool that is used to add, edit, enable, disable, or remove a tag from a website or mobile app.

A tag is a bunch of JavaScript code that is used to collect data from your website/mobile app and then send that data to a third party tool like Google Analytics. In other words, GTM is used to collect data from your website /mobile app and then send it to Google Analytics (GA).

Following are examples of tags: Google Analytics Tracking code, Google Ads Conversion Tracking code, Facebook Pixel Code etc.

GA is a website/mobile app tracking tool. It is used to store, process, and report on the data. In GA, you can query the data either via the reporting interface or via the API. You can not query the data via GTM.

GTM does not report on the data it collects. As a result, GTM does not contain any reports. GA reports on the data collected by GTM via its reporting interface or via the API. As a result, GA provides reports for data analysis.

For more detailed information, check out the article: Google Tag Manager vs Google Analytics – Key differences

What are the advantages of using Google Tag Manager?

Following are the key benefits of using Google Tag Manager (GTM):

  • Benefit #1: GTM removes the need for editing the website code over and over again
  • Benefit #2: Through GTM, you can test and deploy tags very fast
  • Benefit #3: GTM makes advanced analytics tracking possible
  • Benefit #4: GTM makes tag management very efficient
  • Benefit #5: By using GTM, you can improve website speed

For more detailed information, check out the article: Five main benefits of using Google Tag Manager

How to Install Google Tag Manager on a website

gtm tutorial install gtm on a website

Follow the steps below:

  1. Create a new Google Tag Manager account using your Google login.
  2. Login to your GTM account.
  3. Click on the ‘create account’ button.
  4. Name your new GTM account.
  5. Select your country.
  6. Name your new container.
  7. Select ‘web’ as the target platform.
  8. Click on the ‘Create’ button.
  9. Read and accept the Google Tag Manager Terms of Service Agreement as well as data processing terms.
  10. Copy the first part of the GTM installation code and then paste it as high as possible in the <head> section of every page of your website.
  11. Copy the second part of the GTM installation code and then paste it as high as possible in the <body> section of every page of your website

For more detailed step by step tutorial, check out the article: How to Install Google Tag Manager on your website

How to Install Google Analytics on your website via Google Tag Manager

gtm tutorial implement google analytics via gtm

Follow the steps below:

  1. Navigate to your main GA reporting view.
  2. Navigate to the admin section.
  3. Click on the ‘Tracking Code’ link (under Property column > Tracking Info)
  4. Take a note of the tracking ID.
  5. Navigate to your GTM account.
  6. Create a new tag named ‘Google Analytics Tracking – All Pages’ of type ‘Google Analytics Universal Analytics’.
  7. Click on the checkbox ‘Enable overriding settings in this tag‘.
  8. Enter the tracking ID of your GA property in the ‘Tracking ID’ text box.
  9. Select “All Pages” trigger.
  10. Save your tag.
  11. Preview and publish your GTM container.

For more detailed step by step tutorial, check out the article: How to Implement Google Analytics With Google Tag Manager

Introduction to Tags

gtm tutorial gtm tags

A tag is a bunch of JavaScript code that is used to collect measurement and marketing data from your website/mobile app and then send that data to third-party services.

The third-party service could be Google Analytics, Google Ads, Twitter, Facebook, Comscore, etc.

Following is an example of Google Analytics Tag (also known as Google Analytics Tracking code):

<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-XXXX-Y', 'auto');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->

Following is an example of Google Ads (Adwords) Conversion Tracking Tag (also known as Google Ads Conversion Tracking code):

<!-- Google Code for Test Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 928804124;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "wceHCILzjGQQ7drxugM";
var google_conversion_value = 100.00;
var google_conversion_currency = "GBP";
var google_remarketing_only = false;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/?value=100.00"/>
</div>
</noscript>

Following is an example of Facebook Tag (also known as Facebook Pixel Code):

<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','//connect.facebook.net/en_US/fbevents.js');

fbq('init', '879030082151151');
fbq('track', "PageView");</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=879030082151151&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->

Other examples of tags are:

So you see, that tag is just a snippet of code.

You can add this snippet of code (or tag) directly to your website by copying-pasting it in your website template files (like header.php), or you can add the tag indirectly on your website via Google Tag Manager (GTM).

Understanding the Anatomy of Google Tag Manager Tool

If you treat the Google Tag Manager tool like a car, then its engine is the container tag, and its skin (look and feel) and controls are the user interface.

The container tag provides all the functionality needed for the GTM tool to run and deploy tags on your website.

The user interface makes it easy for you, as an end-user, to control the container tag.

Just like, when you drive a car, the car steering makes it easy for you to control the car engine, make it, turn the car left or right.

When coders refer to GTM, they usually refer to the container tag. When non-coders refer to GTM,  they usually refer to the user interface.

Thus depending upon the context, GTM can either mean the ‘container tag’ or the ‘user interface’.

Google Tag Manager Container Tag

gtm tutorial gtm container tag

A container tag is used to hold one or more marketing and analytics tags and their corresponding triggers and variables.

A container tag can be used to deploy Google Analytics on a website. Similarly, a container tag can be used to deploy Facebook pixel tracking on a website. The container tag provides all the functionality needed for Google Tag Manager (GTM) to run and deploy tags on your website. In order to install GTM on your website, you hard code the container tag on every page of your website.

For more detailed information, check out the article: Understanding Google Tag Manager Container Tag

Creating/Using Multiple GTM Accounts

You can create multiple GTM accounts from a single Google Account login.

The rule of thumb is to create one GTM account per company/organization.

You can either create a new GTM account from scratch, or you can add an existing GTM account to your GTM account. Marketing agencies generally ask their clients to add their existing GTM accounts to their GTM account.

Since you can create/add multiple GTM accounts from a single Google account, you don’t need to create several Google accounts for managing multiple GTM accounts.

Visual Representation of the GTM Account Structure

Since the majority of businesses out there have got only one company and one website, their GTM account structure will look like the one below:

gtm tutorial GTM Accout Structure3

If you are a marketing agency that owns/manages multiple GTM accounts, then your GTM account structure will look like the one below:

gtm tutorial GTM Accout Structure2

How to migrate all of your hardcoded tags to Google Tag Manager

gtm tutorial tags migration

Follow the steps below to migrate all of your hardcoded tags (the tags hardcoded on your website) to Google Tag Manager:

  1. Determine your tracking requirements
  2. Do a tag audit of your live website
  3. Create functional and technical designs of your tags
  4. Do tag deployment planning
  5. Do a risk assessment
  6. Create a project scope document
  7. Get buy-in from IT
  8. Setup Google Tag Manager account
  9. Install GTM container tag on the staging website
  10. Create, test and publish tags on your staging website
  11. Install GTM container tag on the live website
  12. Create, publish and test tags on the live website
  13. Do a tag audit of your live website.

In order to learn more about each individual step, read this article: Google Tag Manager Implementation Guide

How to check if Google Tag Manager is Working

gtm tutorial gtm working

The following are the different methods that you can use to check if Google Tag Manager is working on your website:

#1 Check the source code of your website for the GTM container code.

#2 Use the preview and debug mode of Google Tag Manager.

#3 Use the Google Tag Assistant Chrome extension to identify, validate and troubleshoot the installation of various GTM tags.

#4 Check if the GTM script is running in Chrome’s developer console.

#5 Check if the GTM script is running in the ‘Network’ tab of the developer console.

#6 Check the real-time reports in Google Analytics.

To learn more about whether GTM is working on your website, check out this article: How to check if Google Tag Manager is Working – Testing GTM

How to Give Someone Access to a Google Tag Manager Account

gtm permissions

Whenever you give GTM account access to a person, you give that access either at the account level or at the container level.

  • The access given at the account level is called the ‘Account permissions‘.
  • The access given at the container level is called the ‘Container permissions‘.

To learn more about GTM users and permissions, read this article: How to give someone access to Google Tag Manager Account?

How to Export / Import Container in Google Tag Manager

gtm tutorial import export container 1


Through the Export Container feature, you can share your GTM configurations (aka tags, triggers, and variables) with any third party.

What that means, if you want to share your GTM configurations for video tracking with a third party or another website, you can do that via the GTM Export Container feature.

Through the Import Container feature, you can set up dozens of tags, triggers, and variables in a container tag in one go. This can come in handy when you need to set up the same/similar tags, triggers and variables over and over again for multiple websites.

Without using the Import Container feature, you would have to manually set up each tag and its corresponding triggers and variables, and that too over and over again for each website.

To learn more about the export and import container feature in GTM, read this article: Importing – Exporting Container Tag in Google Tag Manager

Introduction to Google Tag Manager Templates

gtm tutorial gtm tag templates

In Google Tag Manager (GTM), a template makes it easy:

  1. To deploy and share a tag with others within your company.
  2. To use and share a variable with others within your company.

The template which is used to deploy a tag on a website is called the tag template, and the template which is used to deploy a variable is called the variable template.

To learn more about tag template, read this article: Guide to Google Tag Manager Templates

Introduction to Triggers

A ‘Trigger’ is a condition that must be met during run time for a tag to fire or not fire.

gtm tutorial gtm triggers

There are two types of triggers:

  1. Firing Triggers
  2. Blocking Triggers

To learn more about triggers, read this article: Google Tag Manager Variables and Triggers Tutorial

Introduction to Variables

A variable is a storage location in the computer memory.

gtm tutorial gtm variables

In the context of GTM, a variable is a function that is called from within another tag, trigger or variable.

In GTM, a variable is denoted by using the following syntax:

{{Variable Name}} 

There are two types of variables in GTM:

  1. Built-in variables
  2. User-defined variables

To learn more about variables, read this article: Google Tag Manager Variables and Triggers Tutorial

Introduction to Folders in Google Tag Manager

gtm tutorial gtm folders

Through folders, you can organize tags, triggers, and variables in GTM by project name, team name, etc.

For example, you can group all of the tags, triggers and variables related to ‘video tracking‘ by creating a folder called ‘video tracking’ and then adding all of the related tags, triggers, and variables to it.

To learn more about folders in GTM, check out this article: Introduction to Folders in Google Tag Manager

Pagination for GTM Tags

If your GTM container has got more than 50 tags, then the tag list is paginated. By default, only 50 tags are displayed at a time on a page, which speeds up the user interface.

You can see the paginated list by clicking on the ‘Tags’ link on the left-hand side navigation and then scroll down to the bottom of the page:

gtm tutorial gtm tags
gtm tutorial tag list paginated

Click on the > button to go to the next page.

Click on the < button to go to the previous page.

You can also click on the ‘Show Rows’ drop-down menu and click on ‘ALL’ to see all the tags listed on a single page:

gtm tutorial show rows drop down menu

Pagination for GTM Triggers

If your GTM container has got more than 50 triggers, then the trigger list is paginated. By default, only 50 triggers are displayed at a time on a page.

You can see the paginated list by clicking on the ‘Triggers’ link on the left-hand side navigation and then scroll down to the bottom of the page:

gtm tutorial triggers

Pagination for GTM Variables

If your GTM container has got more than 50 variables, then the variable list is paginated. By default, only 50 variables are displayed at one time on a page.

You can see the paginated list by clicking on the ‘Variables’ link on the left-hand side navigation and then scroll down to the bottom of the page:

gtm tutorial gtm variables2

Search Feature in Google Tag Manager

In Google Tag Manager, you can search for a particular tag, trigger or variable by using the inbuilt search box.

You can see this search box embedded on the left-hand side in your GTM workspace:

gtm tutorial gtm search

Through this search box, you can search for any tag, trigger or variable:

gtm tutorial gtm search results2 1

When you click on a search result, you are redirected to a particular tag/trigger/variable.

How to search only among tags in Google Tag Manager

If you want to search only among tags then follow the steps below:

Step-1: Click on the ‘Tags’ link on the left-hand side menu:

gtm tutorial gtm tags

Step-2: Click on the ‘Magnifying glass located on the right and then enter your search term:

gtm tutorial gtm search
gtm tutorial search results

Similarly, you can perform a search among triggers and variables.

Introduction to Data Layers in Google Tag Manager

gtm tutorial data layer

In the context of GTM, a data layer is a JavaScript array that is used to collect and store data from a website and then send that data to the GTM container tag. Google recommends using data layers for retrieving run time information.

Your web developer can set up a data layer for you. This data layer contains all the information you want to send to the container tag. 

In order to get the most out of GTM, you need to understand and use data layers. I have explained data layers in great detail, in the article: Google Tag Manager Data Layer Tutorial with Examples.

Resources for Getting Started with Google Tag Manager


Read the following articles one by one, in the order in which they are mentioned:

#1 Google Tag Manager Data Layer Tutorial with Examples

Google Tag Manager Data Layer

GTM is a really powerful tool and understanding the data layer is the key to getting the most out of Google Tag Manager. A data layer provides a safer and more reliable way to pull data from the presentation layer and send it to the container tag (aka GTM).

To get the most out of GTM, you need to know and use data layers. This article will teach you to create simple and complex data layers within a few minutes. Always remember, GTM works best when used with data layers.

#2 Google Tag Manager Variables and Triggers Tutorial

gtm tutorial variables gtm

In order to use GTM, you need to get familiar with the usage of triggers and variables. A trigger is a condition that must evaluate to either true or false at run time.

In GTM, triggers are an integral part of a tag creation process. So you can not create a tag without first creating the corresponding trigger.

In the context of GTM, a variable is a function that can be called from within a tag, trigger, or another variable. A variable tells GTM where to fire a tag.

#3 Google Tag Manager Implementation Guide

gtm tutorial install google tag manager

Go through this article before you migrate all of your hardcoded tags to GTM. If you don’t, then there is a high probability that you may lose a considerable amount of tracking data during migration esp. if your website is big and complex.

You need a proven process in place before you migrate all of your hard-coded tags to GTM.

If you do not follow a formalised process then there is a high probability that you may lose a considerable amount of tracking data during migration esp. if your website is big and complex.

Google Tag Manager set up includes the following thirteen steps:

  1. Determine tracking requirements
  2. Do Tag Audit of your live website
  3. Create functional and technical designs of your tags
  4. Do tag Deployment Planning
  5. Do the Risk Assessment
  6. Create a Project Scope document
  7. Get buy-in from IT
  8. Setup Google Tag Manager Account
  9. Install GTM container tag on the staging website
  10. Create, test and publish tags on your staging website
  11. Install GTM container tag on the live website
  12. Create, publish and test tags on the live website
  13. Do a tag audit of your live website.

#4 Google Analytics Javascript Tutorial

gtm tutorial javascript tutorial ga

Google Analytics itself is a JavaScript library, and there is heavy use of JavaScript in GTM. So it is important that you understand what JavaScript is and how it can be used to collect data via GTM.

#5 Analytics.js – The Google Analytics JavaScript Library – Tutorial

gtm tutorial analytics js

Analytics.js is the engine that power Google Analytics. Whenever we refer to GA in the context of coding, we are actually referring to the analytics.js JavaScript library. 

The first step towards understanding the Google Analytics Developers environment is to understand the analytics.js JavaScript library.

#6 Introduction to Google Analytics Commands

gtm tutorial ga commands 1

In order to set up / troubleshoot any GA/GTM implementation, whether it is ecommerce tracking, cross-domain tracking, event tracking or enhanced ecommerce tracking, you need to understand how the ga() command queue function works.

#7 Page Tracking in Google Analytics – ga send pageview

gtm tutorial page tracking ga

Through page tracking, you can measure the number of times a page was shown to your website users in GA. This can be done by sending a pageview hit each time a page is shown. Implementing Page tracking is another step in understanding the Google Analytics Developers environment.

#8 Advanced Google Analytics Tracking – HTML DOM – Tutorial

gtm tutorial advanced ga tracking

DOM stands for the ‘Document Object Model’.

DOM is a set of programming interfaces and objects designed for managing HTML and XML documents. It defines the logical structure of a document and the way document elements can be accessed and changed.

In order to get the most out of GTM, you need to know what DOM is and how it can be traversed. Without adequate knowledge of DOM, you would have a hard time implementing any tracking via GTM.

FAQ: How to use Google Tag Manager to its full potential?

If your event tracking is not working, then it is not because you do not understand GTM really well.

But it is most likely because you do not understand how to correctly traverse the HTML DOM.

Because of that, you are not able to capture the page element, and your trigger does not work correctly.

Just because you understand what event category/label is and you can fire an event tag does not automatically mean you can also correctly traverse the DOM.

[Traversing the DOM] is an entirely different skill set than event tracking, which no GTM course instructor ever teaches you. But that’s the real skill.

If you really want to use GTM effectively, then learn to traverse the DOM. Learn HTML and JavaScript.

#9 Regex Google Analytics & Google Tag Manager – Tutorial

Regular Expression is an expression that is used to check for a pattern in a string.

For e.g. ^Colou?r$ is a regular expression that matches both the string: ‘color’ and ‘colour’.

A regex is made up of characters and metacharacters:

characters and metacharacters

Regular expressions are frequently used in setting up Lookup Table Variables and/or Regex Table Variables in Google Tag Manager.

Regular expressions are frequently used in setting up complex goals and filters in GTM:

gtm tutorial regxe ga gtm

Without the use of regex, you will have a hard time creating useful triggers in GTM.

#10 Google Analytics Notifications and Alerts Guide

Google diagnostic is a feature of Google Analytics that makes regular evaluations of your Google Analytics tracking code, account configuration, and data in order to find implementation issues and configuration anomalies.

Once it finds issues, it alerts the GA user through a special message known as a diagnostic notification (also known as ‘Analytics Notifications’).

These notifications appear as a number over the notification bell in your Google Analytics (GA) view:

analytics notifications 1

Google Analytics diagnostic is a feature of Google Analytics through which you can identify and understand implementation issues.

When you are setting up GTM to deploy various tags on your website, this diagnostic feature will help you a lot in debugging setups (like ecommerce tracking).

#11 Google Tag Assistant Tutorial

Google Tag Assistant is a chrome extension that is used to identify, validate, and troubleshoot the installation of various Google Tags on a web page.

gtm tutorial google tag assistant tutorial

The following are the various functions of Google Tag Assistant:

#1 Display the list of various Google Tags installed on a web page

#2 Report on implementation errors.

#3 Suggest fixes by providing useful tips and links to help articles.

#4 Record user flow across web pages/websites to identify implementation and configuration issues. 

Google tag assistant is a must-have tool for GTM debugging.

#12 Google Tag Assistant Recordings Tutorial

Google Tag Assistant Recording is used to identify, validate, and troubleshoot the installation of various Google tags across many pages:

record google tag assistant

Google Tag Assistant recording is one of the most useful features of Tag Assistant through which you can see the tags and events that were fired, for example, during the checkout process. You can record tags, events and interactions for any set of pages.

Google Tag Assistant by default can’t validate tags across multiple pages. But by using the recording feature, you can make the tag assistant validate tags across many pages.

Through the recording feature, not only you can record the tags across many pages but you can also record events and interactions for any set of pages you visit, either on your own website or some other website(s).

#13 Google Tag Manager vs Google Analytics – Key differences

gtm tutorial ga vs gtm

This article outlines the main differences between Google Tag Manager (also known as ‘GTM’) and Google Analytics (also known as ‘GA’).

#14 How to give someone access to Google Tag Manager Account?

gtm tutorial give someone access to gtm

Whenever you give GTM account access to a person, you give that access either at the account level or at the container level. The access given at the account level is called the ‘Account permissions’. The access given at the container level is called the ‘Container permissions’.

#15 How to find Google Tag Manager ID (Container ID)

The part of the GTM container tag code which reads ‘GTM-TXAAA’, it is called the container ID:

gtm tutorial Google Tag Manager container id

Learn to get Google Tag Manager (GTM) Container ID through this easy-to-understand step-by-step guide. The container ID is used to uniquely identify each GTM container tag.

#16 How to add Google Optimize via Google Tag Manager

gtm tutorial google optimize google tag manager

Learn to add Google Optimize via Google Tag Manager through this step by step guide. Google Optimize is a free to use website optimization tool from Google. Through this tool, you can test different versions of your landing pages.


Advanced Google Tag Manager Resources


#1 Ecommerce Tracking Google Tag Manager (GTM) – Tutorial

gtm tutorial implement ecommerce tracking gtm

Learn to Implement E-Commerce Tracking through Google Tag Manager via this easy-to-understand step-by-step guide.

#2 Google Tag Manager Workspaces Tutorial

gtm tutorial gtm workspaces

Learn all about Google Tag Manager Workspaces through this easy to understand guide. 

A workspace is a container draft. When you create a new workspace in GTM, you are, in fact creating a new container draft.

So creating 2 new workspaces means, creating 2 new container drafts. Each container draft remains separate from other drafts.

#3 Tracking Virtual Pageviews in Google Tag Manager – Tutorial

Learn to track virtual pageviews in Google Tag Manager through this easy to understand, step by step guide.

gtm tutorial tracking virtual pageviews gtm

A virtual pageview is that pageview hit, which you send to Google Analytics without loading a web page in your web browser.

Any user interaction, which is equivalent to a page being viewed, can be tracked via virtual pageviews.

One advantage of virtual pageviews over events is that when you set up goals in GA, you can use virtual pageviews as funnel steps in Google Analytics.

You can’t use tracked events as funnel steps while setting up goals in GA.

#4 Google Tag Manager User ID – Cross-device tracking via GTM

Learn to implement cross-device tracking with the User ID in Google Tag Manager through this easy step by step guide:

gtm tutorial Google Tag Manager User ID

The user id is a unique set of alphanumeric characters assigned to a user so that he/she can be identified across devices/ browsers and over the course of multiple sessions.

#5 Setting up Dynamic Remarketing via Google Tag Manager

Learn to set up dynamic remarketing in Google Analytics and Google Ads via Google Tag Manager.

gtm tutorial dynamic remarketing gtm

Remarketing is a technique that is used to re-target people who left your website and/or mobile app without completing a goal conversion (like making a purchase).

The people who are re-targeted are known as the remarketing audience. This audience is shown one or more targeted ads that are based on their past browsing behaviour.

In the case of dynamic remarketing, Google automatically creates re-targeted ads for your website visitors which are based on the actual product (or related products) or services they viewed on your website.

#6 Google Tag Manager Event Tracking Tutorial

gtm tutorial gtm event tracking 1

Through this article, you will learn the following:

  1. Tracking clicks on a link via Google Tag Manager
  2. Tracking clicks on an image link via Google Tag Manager
  3. Tracking clicks on a button via Google Tag Manager
  4. Tracking clicks on the button which is embedded across a website
  5. Tracking form submissions
  6. Tracking Form Fields
  7. Video Tracking via Google Tag Manager
  8. Scroll Tracking via Google Tag Manager
  9. Tracking Clicks on external links across a website (Exit Tracking)

#7 Cross-Domain Tracking with Google Tag Manager (GTM)

Learn to implement cross-domain tracking in Google Tag Manager between two or more primary domains and their subdomains.

gtm tutorial cross domain tracking gtm

Google Analytics can not track across multiple domains, sub-domains or top-level domains by default.

This is because Google Analytics uses first-party cookies, which can be read by only that domain (website) that issued it.

#8 Implementing Scroll Tracking via Google Tag Manager

Learn to Implement Scroll Tracking through Google Tag Manager via easy to understand step by step guide.

scroll tracking google analytics

Scroll tracking is one of the methods of measuring how people are consuming your website content.

People who actually read your article are most likely to scroll your article page, and by measuring the percentage of the scroll, you can get a good idea of content consumption.

If the majority of people do not scroll to the bottom of your articles then something may be wrong with your content.

#9 Adjusted Bounce Rate Google Tag Manager

Learn to adjust the bounce rate in Google and Universal Analytics via Google Tag Manager.

gtm tutorial adjusted bounce rate gtm

Bounce rate is the percentage of single-page visits (or web sessions). It is the percentage of visits in which a person leaves your website from the landing page without browsing any further.

Google analytics calculates and reports the bounce rate of a web page and bounce rate of a website.

We need to adjust the bounce rate so that we can see the true bounce rate metric in our Google Analytics report.

#10 Google Tag Manager Alternative – Segment

Understand the limitations of Google Tag Manager through this article.

gtm tutorial gtm alternative

As your need to integrate website data with various data sources increases and becomes more complex, you quickly realize how hard it can be to create and maintain each integration in GTM.

In GTM we create integration with each data source via ETL (extract, transform, load).

#11 Segment vs Google Tag Manager (GTM)

Learn to install and use Google Tag Manager in Segment.com.

gtm tutorial segment vs gtm

The ‘Segment’ is a tool used to route/send data between multiple data sources.

The role of ‘segment.com’ is to ‘Extract’, ‘Transform’ and ‘Load’ data between different data sources.  It acts as a hub between originating and destination data sources.

Both ‘segment’ and ‘GTM’ are primarily designed to be used by developers. However, unlike GTM, ‘segment’ is much more non-developer friendly as it has the ability to automate many ETL functions.

#12 Content Grouping Google Tag Manager – Setup Tutorial

Through this article, you will learn to set up content grouping in Google Analytics via Google Tag Manager.

gtm tutorial gtm content grouping

In the context of Google Analytics, a ‘Content grouping’ is a rule-based grouping of related content groups. It is made up of one or more content groups.

For example, if you sell clothes for both men and women on your website then all the web pages which sell men’s clothes can belong to the ‘Men’ content grouping.

Similarly, all the web pages which sell women’s clothes can belong to the ‘Women’ content grouping.

#13 How to install Google Tag Manager on your WordPress Website

gtm tutorial install gtm wordpress

Learn to correctly install Google Tag Manager on your WordPress Website through this easy-to-understand step-by-step guide.

#14 Google Analytics Settings Variable in Google Tag Manager Explained

Through this article you will learn to create and use the ‘Google Analytics Settings’ variable in Google Tag Manager:

gtm tutorial google analytics settings variable

Manually updating each and every ‘Universal Analytics’ tag to make sure all such tags have the same basic configuration options is time-consuming and not practical esp. if you have got dozens or even hundreds of Universal Analytics tags.

Here the ‘Google Analytics Settings’ variable comes in handy. 

Through this variable, you can set, change and apply any or all of the configuration options under ‘More Settings’ (like ‘Fields to Set’, ‘Custom Dimensions’, ‘Custom Metrics’, ‘Content Groups’, ‘Ecommerce’ etc.) from one central location to all tags of type ‘Universal Analytics’.

#15 Google Tag Manager Shopify Installation Guide

Learn to install GTM on your Shopify store through this easy-to-understand step-by-step guide.

gtm tutorial gtm shopify installation

If you are into ecommerce, chances are, you have heard of ‘Shopify’. It is one of the most popular, ready-made shopping cart solutions in the world. Hundreds of thousands of websites use ‘Shopify’.

Shopify directly integrates with Google Analytics. The set-up is pretty simple. But when it comes to Google Tag Manager, there is no direct integration.

#16 Google Analytics Shopify Tracking via Google Tag Manager

Are you using Google Tag Manager, or do you want to use GTM for your Shopify Store? If that is the case, then do not deploy the Google Analytics tag via Google Tag Manager. 

If you used GTM to install Google Analytics on your Shopify store (which you technically can), then your cross-domain tracking won’t work. 

cross domain tracking shopify

So do not use GTM to deploy Google Analytics on your Shopify Store.

#17 Scroll Depth Tracking in Google Tag Manager – Tutorial

Learn to use the new Scroll depth trigger in Google Tag Manager to track how far website visitors scroll contents on your website.

gtm tutorial Scroll Depth Tracking gtm

The term which denotes how far website visitors scroll contents on your website is called the ‘Scroll Depth’. This scroll depth can be vertical or horizontal depending upon the type of scrolling available on your website.

The tracking method which is used to measure ‘Scroll Depth’ is called ‘Scroll Depth Tracking’ or ‘Scroll Tracking’.

#18 Google Tag Manager Youtube Video Tracking via YouTube Video Trigger

Learn to use the YouTube Video trigger in Google Tag Manager…to track YouTube videos embedded on a webpage.

gtm tutorial gtm video tracking

The tracking method which is used to track/capture the various player states of an embedded video is called ‘video tracking’. A player state is specific user interaction with a video.

Following are the example of various player states which can be captured for YouTube videos via GTM:

  1. Start
  2. Pause
  3. Seek
  4. Buffering
  5. Progress
  6. Complete

#19 GTM (Google Tag Manager) Debugger Console Tutorial

Through the Google Tag Manager preview and debug console window, you can make sure that your tags, triggers, variables and data layers work as expected. 

gtm tutorial gtm debug console

By default, what you actually preview and debug is the deployment of the current container draft on your website. You preview and debug the container draft on your website as if it is currently deployed.

#20 Sending Google Analytics Client ID via GTM (Google Tag Manager)

Learn to send Client ID to Google Analytics via Google Tag Manager through step by step guide.

gtm tutorial client id gtm

Google Analytics identifies a user as unique through a combination of unique random numbers and the first timestamp (i.e. the time of the first visit), called the ‘Client ID’.

This ID is created and assigned by Google Analytics cookie _ga.

#21 Secret to Setup Facebook Pixel Tracking Correctly in Google Tag Manager

gtm tutorial secret facebook pixel tracking

Did you know that your Facebook Pixel tracking in Google Tag Manager is probably not set up correctly and is costing you money? This article will show you how to set up Facebook Pixel Tracking Correctly when using Google Tag Manager.

#22 Importing and Exporting Container Files in Google Tag Manager

This is a complete guide to importing and exporting containers in Google Tag Manager.

gtm tutorial exporting container files gtm

Through the export container feature, you can share your GTM configurations (aka tags, triggers and variables) with any third party.

What that means, if you want to share your GTM configurations for video tracking with a third party or another website, you can do that via GTM export container feature.

If you want to share the GTM configurations of your entire container with a third party or another website, you can do that via GTM export container feature.

If you want to share a particular container version or workspace, you can do that via GTM export container feature.

The GTM export container feature is basically equivalent to downloading a particular container version or workspace.

#23 Anonymize IP in Google Analytics, gtag & Google Tag Manager

Learn to turn on IP Anonymization in Google Analytics and Google Tag Manager through this step by step guide.

gtm tutorial Anonymize IP

If your privacy policy or local privacy laws prevent the storage of full IP addresses, then you can use the IP anonymization feature to anonymize/mask website visitors IPs.

This will help you in complying with GDPR (General Data Protection Regulation).

When you anonymize visitor IP, the last three digits from your website visitor’s IP address are automatically dropped/deleted.

In other words, the IP anonymization feature sets the last octet of IPv4 user IP addresses and the last 80 bits of IPv6 addresses to zeros.

#24 How to use custom templates in Google Tag Manager

gtm tutorial custom templates gtm

Learn to use custom templates in Google Tag Manager through this step by step guide.

#25 GTM Server Side Tagging Tutorial

gtm tutorial GTM Server Side Tagging

Learn about server-side tagging in Google Tag Manager through this step by step guide.

#26 Google Tag Manager Audit Checklist

gtm tutorial gtm audit

Use this Google Tag Manager Audit Checklist to check if your GTM implementations are working as expected. This checklist covers all the basic steps and ensures that your GTM setup meets your client’s needs.

#27 How to Create Server Side Container for Google Tag Manager

gtm tutorial server side container gtm

Learn to create a server-side container for Google Tag Manager through this step by step guide. The GTM server-side container allows you to set up server-side tracking.

#28 How to Configure DNS for GTM Server Side Container

gtm tutorial configure dns server side container

Learn to configure DNS for GTM Server Side Container through this step by step guide. It is strongly recommended that you map your custom domain to the Google Tag Manager server-side container.

#29 How to send data from Website to Server Side Container

gtm tutorial universal analytics

Learn to send data from website to server-side container through this step by step guide.

#30 How to track single page apps in Google Analytics via GTM

gtm tutorial single page app

Learn to track single page apps in Google Analytics via GTM (Google Tag Manager) through this easy-to-understand step-by-step guide.

#31 How to set up GA4 via GTM Server Side Tagging

gtm tutorial ga4 server side

Learn to set up GA4 via GTM Server Side Tagging through this step by step guide. 

#32 How to Pull Ecommerce Data From Data Layer in GTM

data layer checker

Learn to pull Ecommerce Data From Data Layer in GTM through this step by step guide. Step-1: Navigate to your GTM container and click on ‘Variables’ Step-2: Click on ‘New’ under ‘User-Defined Variables’…

#33 How to track Facebook events via Google Tag Manager

facebook events gtm

Learn to track Facebook events via Google Tag Manager through this step by step guide.

#34 How to add Facebook Pixel to Google Tag Manager

facebook pixel gtm

Learn to add Facebook pixel code to GTM. Make sure that you are already logged in to your GTM account and that you have the ‘Publish’ permission at the container level.

#35 How to check if Google Tag Manager is Working – Testing GTM

gtm working

In this article, I am going to talk about how to check if Google Tag Manager (GTM) is working. We will go through different ways to test GTM is working. The first method to check if Google Tag Manager is working or not is by identifying the GTM container code in the source code of the website. 


Google Tag Manager Tools

Another article you will find useful: Implementing rollup reporting in Google Analytics 

Frequently Asked Questions (FAQ) about Google Tag Manager

What is Google Tag Manager?

Google Tag Manager (also known as GTM) is a free tag management solution provided by Google. Through this ‘online tool’, you can deploy and manage various marketing and analytics tags on a website or mobile app.

What is a tag in Google Tag Manager?

A tag is a bunch of JavaScript code which is used to collect measurement and marketing data from your website/mobile app and then send that data to 3rd party services. The third-party service could be: Google Analytics, Google Adwords, Twitter, Facebook, Comscore etc

What is the advantage of using Google Tag Manager?

When you use Google Tag Manager (GTM) to add tags on a website, you get more control over: 1) When the tag should fire. 2) When the tag should not fire. 3) Where the tag should fire. 4) Where the tag should not fire and What the tag should do, when it get fired (executed). GTM removes the need for editing the website code over and over again just for adding, removing or editing tags.

What is a container tag?

GTM removes the need for editing the website code over and over again just for adding, removing or editing tags. Instead, one code is placed on every page on the website, which is the GTM container code/tag. This container code literally acts as a container, as it can store and deploy several marketing and analytics tags. If you treat Google Tag Manager tool like a car, then its engine is the container tag and its skin (look and feel) and controls are the user interface. The container tag provides all the functionality needed for GTM tool, to run and deploy tags on your website.

What is GTM Container ID?

The part of the GTM container tag code which reads ‘GTM-TXAAA’, it is called the container ID. This ID is used to uniquely identify each GTM container tag.

What is a Google Tag Manager Account?

https://tagmanager.google.com/ is your GTM account.

What is the difference between Google Tag Manager and Google Analytics?

GTM is a tag management tool. Whereas Google Analytics is a website/mobile app tracking tool. Through GTM you can: add, edit, enable, disable or remove any tag, with just few button clicks. That is something, which is not possible with Google Analytics. ‘GTM’ is primarily used to route data from one data source to another (like from your website to Google Analytics or from your website to a data warehouse). It is not a data source in itself. Whereas Google Analytics is a data source in itself.

Can I use Google Tag Manager even when I don’t use Google Analytics?

Yes. GTM is a tag management solution and can be used to deploy non-google tags.

How I can deploy non-google tags via GTM?

Through custom HTML tags or 3rd party tag templates.

Does GTM work on mobile websites and mobile apps?

Yes.

Will the use of GTM, slow down my website?

No. Since GTM fire tags asynchronously, it can actually improve the website speed. However, there is one caveat here. If your container tag is very large (contains lot of tags, triggers and variables) then it can negatively affect the website speed. So if you are not using a particular tag, trigger or variable and you have no plan to use it in the future then remove it from the container.

Can I use Google tag manager in parallel with hard-coded tags?

Yes. If complete migration of all of your tags is not possible. However, you need to make sure that you don’t do double tagging i.e. deploy same tag twice, once via GTM and once without GTM.

Register for the FREE TRAINING...

"How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own."



Here’s what we’re going to cover in this training…

#1 Why digital analytics is the key to online business success.

​#2 The number 1 reason why most marketers are not able to scale their advertising and maximize sales.

#3 Why Google and Facebook ads don’t work for most businesses & how to make them work.

#4 ​Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.

#5 The number 1 reason why conversion optimization is not working for your business.

#6 How to advertise on any marketing platform for FREE with an unlimited budget.

​#7 How to learn and master digital analytics and conversion optimization in record time.



   

My best selling books on Digital Analytics and Conversion Optimization

Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.

Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.

Attribution Modelling in Google Analytics and BeyondSECOND EDITION OUT NOW!
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.

Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.

About the Author

Himanshu Sharma

  • Founder, OptimizeSmart.com
  • Over 15 years of experience in digital analytics and marketing
  • Author of four best-selling books on digital analytics and conversion optimization
  • Nominated for Digital Analytics Association Awards for Excellence
  • Runs one of the most popular blogs in the world on digital analytics
  • Consultant to countless small and big businesses over the decade
error: Alert: Content is protected !!