Chapter 8 of 12:

Well, I just got my first round of the COVID-19 vaccination and it’s showing…so this may disappoint or delight you depending on if my brand of humor matches yours that I will not be nearly as snarky or whimsical in this post. Apologies in advance. Now, in this week’s blog post I want to conduct a macro-to-microscopic overview and deep dive of Google Tag Manager and its components as I learned them from CXL Institute’s Digital Analytics mini-degree program.

So what is a Google Tag Manager, anyways? Well, Google Tag Manager is a Tag Management System (TMS) that allows you to manage, update, and control all of your data tracking measurement codes (also known as “Tags”) within a unified, centralized, wildly scalable platform. What makes Tag Management Systems so awesomely valuable, in general, is that the web-based user interface (UI) allows you to manage your tracking protocols and data collection codes with the need of minimal assistance from a developer — the working keyword here are “minimal” especially since you will need the help of a developer to install the TMS tracking code on the HTML document that makes up your website.

Google has gone to great lengths to make the Tag Manager UI as simple and user-friendly as possible. The installation and setup of GTM are quite simple:

  1. If you do not already have a Gmail account, you will need to create one in order to create a Google Tag Manager account.
  2. Next, go to https://tagmanager.google.com and create an account.
  3. You will be prompted to give your account a name (e.g., your website or company name)
  4. You’ll configure your country and add your website URL.
  5. Then you will select the format of the digital property you are installing GTM on, (in most cases you will select “Website” but it’s a case by case basis:
  • Website
  • iOS App
  • Android App
  • AMP (Accelerated Mobile Pages)
  • Server (for server-side tagging)

Last, you click create and provide the <head> and <body> code snippets to your developer and instruct them to place each as high as possible in its respective section and now…Bob’s your uncle, that’s that, and you’re good to go…

Now you can proceed to install your first tag! Well, not quite so fast, before we jump into that a couple of things that I like to do to make your tagging, testing, and deploying efforts more smooth, I recommend enabling the Built-in variables that allow you to capture various user behavior data. But, I’m getting ahead of myself.

GTM Tags:

Let’s briefly discuss the concept of tags, what are tags? Simply put, tags are simply the instructions that you provide to Google Tag Manager that tell it what to do and how to do it. There are two categories of tags that are provided in the GTM interface:

  1. Built-in (Templated) Tags: (e.g., Universal Analytics Tag, Adwords Conversion Tag, Facebook Pixel, etc.)
  2. The Custom Tags: Custom HTML tags that you code in JavaScript and Custom Image tags.

GTM Triggers:

Next let’s quickly discuss triggers, similar to tags that tell GTM what to collect and how to collect it, triggers the GTM exactly WHEN to collect the data. Triggers are enormously useful in allowing for greater accuracy and precision in your data collection efforts. Without triggers it would be like closing your eyes, casting out a humongous digital net, and then accepting whatever data comes back. Not a great method for finding insights or actionable data, if you ask me.

Google Tag Manager offers quite a few trigger options from pageviews to clicks to scroll depth and beyond. But wait, there’s more…okay, I like my itemized lists if you can’t tell:

The Pageview Trigger has three trigger subsets (from earliest to latest):

  1. Pageview (gtm.js) which allows you to fire when GTM loads the gtm.js script on the page.
  2. DOM loaded (gtm.dom) which allows you to fire after the gtm.js library has loaded, and the DOM (Document Object Model) has finished loading.
  3. Window loaded (gtm.load) which allows you to fire a tag after everything in the window has completed loading.

The Click Trigger has two trigger subsets:

  1. Element Clicks (gtm.click) which allows you a greater degree of flexibility to fire when a user clicks on any type of element on the webpage.
  2. Link Clicks (gtm.linkClick) which allows you to fire ONLY when the element that is clicked is attached to a link or URL.

The User Engagement Triggers has four trigger subsets:

  1. Element Visibility (gtm.elementVisibility) allows you to see when an element is visible on the page. This is particularly useful when dealing with single page applications (SPAs) that don’t have “destination pages” that mark a user’s journey.
  2. Form Submissions (gtm.formSubmit) is an event listener that allows you to fire when a form has been submitted.
  3. Scroll Depth (gtm.scroll) allows you to track the amount or percentage of depth that a user scrolls on any particular page.
  4. YouTube Video events, which is pretty self-explanatory.

The Other triggers GMT offers have five trigger subsets:

  1. Custom Event (gtm.event) which I find is often quite helpful when working with the dataLayer.
  2. History Change (gtm.history) is another useful trigger when dealing with SPAs or changes that occur on a specific page that you would like to track.
  3. JavaScript Error which allows you to capture various types of JavaScript errors.
  4. Timer (gtm.timer) allows you to track the amount of time a user spends on a page. This is quite useful as a workaround to how Google Analytics is configured to track time on page and session duration for users that visit only one page of your site and then exit.
  5. Trigger Group allows you to group triggers together when multiple qualifying events need to take place before collecting the necessary data.

Another severely cool thing about various GTM triggers and variables is that it allows you a lot of flexibility in what you can use in your configurations (e.g., CSS Selectors, Element Classes, IDs, URLs, etc., and Regular Expression).

Okay, so far we’ve covered the “what, how, and when” for Tag Manager to collect the data which leaves the variable, which provides a categorical “container” that Tag Manager can use to conduct the actual collection and storage of the data it’s been instructed to gather. Variables are amazing and demand a blog post all their own where they can be adequately explained and we can put everything together and start collecting data, so…until next time…

GTM Variables, the final frontier…(to be continued)…

Just a nomadic digital analyst finding his way to great light and knowledge through sharing it with you!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store