GTM

Getting Started With Google Tag Manager: 2022 Complete Guide

July 20, 2022
Google Analytics 4 Migration Via Tagmate

You must have heard of Google Tag Manager (GTM) and how it can help you track events like form submission and purchases on your website.

But what exactly is GTM?

GTM is a tool that helps developers and website owners to easily create, deploy, and track tags on websites without having to edit the source code. 

It manages all tags on your website be it marketing pixels, javascript code, or a custom HTML code.

As per w3techs survey, 43.3% of the organizations use a tag management system for their tracking needs. Out of these, 98% of the organizations have employed GTM on their website.

Let’s see some functionalities of GTM that make it the most sought-after.

With GTM you can easily track:

  • The number of users who have downloaded any content resource.
  • Form submissions.
  • How users interact with forms.
  • Events such as click events, link clicks, and others.
  • Track video player events like the start of the video, push, play, forward, watch time, and so on.
  • Scroll tracking, reading time, scanning time, number of page views, and track page sequences.
  • Ecommerce events for instance add-to-cart, product clicks, check-out, shipping info, purchase events, and so on.
  • Custom events that have a data layer.

This is not an exhaustive list… there are many more events that you can track with GTM.

 

Now that you are clued up with the value that GTM could bring to your business, let’s deep dive into the structure of GTM.

Components of GTM

The GTM structure consists of containers, tags, triggers, and variables as you can see in the image below.

Google Tag Manager Example Structure | Source

Tags 

Tag is nothing but a snippet of code. Tags represent the platform whose data you want to track. Some examples of tags are Google Analytics, Facebook Ads, and Google Ads.

Triggers

Triggers are the conditions on which a particular tag fires. Some common triggers are pageview, link click and form submission.

Examples of Triggers in Google Tag Manager

For instance, as you can see in the image below, the trigger type is Form Submission. This denotes that the tag will fire when a website visitor submits the form.

Trigger configuration screen in Google Tag Manager

 

The trigger here answers three questions:

Where to track tags?

  • On the contact page.

When to track tags?

  • When the user submits the contact form.

How to track tags?

  • Method of form type, say form has proper element <form> which generates ‘submit’ event.

 

Variables

Variable is the value on which a trigger evaluates its condition.

It is used to store information about data layers.

For instance, for an add-to-cart event, you want to know the category and price of the product. In this case, variables need to be created to capture the values of category and price.

Variables are reusable, like in the above example of the add-to-cart event, the variable can be reused for add-to-cart events of all products.

These are the variables that are available in the GTM:

 

Types of Variables available in Google Tag Manager

Now that we are familiar with tags, triggers, and variables. Let’s have a look at how to create a tag in GTM.

How to create a tag in GTM?

Step 1:  Create an account 

 

Creating new account in Google Tag Manager

Step 2:  Create a tag

Click on ‘Tags’ on the left navigation panel. Click on the ‘New’ button at the top-right corner.

Creating new tags screen in Google Tag Manager

Step 3: Name the tag

Enter the name of the tag.

In this guide, we will create a Google Analytics 4 tag to push data to GA4.

For creating a GA4 tag, click on ‘Google Analytics: GA4 Configuration’ on the right navigation bar.

Creating GA4 Tag in Google Tag Manager

 Step 4: Enter measurement ID, event name, and triggering details

 

Entering Measurement ID, Event Name and Triggering details

 

Now you can see the tag created in the dashboard as shown in the image below.

Final Tag created in the Google Tag Manager

 

How to Install a GTM container on the website?

 

Step 1: Click on the container ID

On the dashboard, click on the container ID as highlighted in the red box in the image below.

Container ID in Google Tag Manager

Step 2:  Copy the first code

Container code to be placed in <head> element

Step 3: Go to admin of your website

For a WordPress site, click on  ‘Appearance’ and then ‘Theme FilenEditor’ on the left navigation panel.

Theme File Editor in Wordpress

Step 3: Open the header.php file and paste the code right below the <Head> element

Paste the 1st container code in <head> element of header.php file

 

Step 4: Copy the second snippet of code

2nd Container code to be placed in <body>

Step 5: Open the header.php file and paste the code right below the <body> element

Paste the 2nd container code in the <body> element of header.php file

Step 6: Update the file

Step 7: Open your website in browsers and inspect elements.

For inspecting element, press Ctrl + shift + c  on windows.

Check the code in the <head> element as per below. You will see your GTM’s container ID.

GTM Container ID placed on your website

As you can see, creating tags, triggers, and variables in GTM is no kid’s stuff! It becomes even more cumbersome with custom events and each additional parameter. And when you want to track hundreds of elements on your website, it is a tough row to hoe!

In such a case, you need a tool that automates setting up of tags.

This is where Tagmate comes in handy. 

Tagmate is a low-code tool that lets you track tags within a matter of seconds ensuring 100% accuracy.

With Tagmate, you can set up an array of tags such as,

✅ GA4 Events

✅ UA to GA4 Migration

✅ Google Ads Marketing Pixel

✅ FB Ads Marketing Pixel

 

Not only this, you can track custom event in just 3 clicks with Tagmate Tracker Chrome Extension!

 

Want to see how? Have a look at how Tagmate Tracker works.

Tags
Google Tag Manager
GTM Guide
GTM Container ID
Google Tag Manager Setup
Variables in Google Tag Manager
Tags in Google Tag Manager
Triggers in Google Tag Manager
GTM setup in Wordpress
GA4 vs UA comparison on 70+ features
Download for Free NOW!
Stay a step ahead.
Get served hottest tracking posts from industry-experts every week.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Ready to Get Started
Stay Updated
Subscribe to get the latest news, industry trends, blog posts, and updates.

Set up tags in seconds.
Not days.

Start Free Trial