Google Tag Manager is an easy to use tool to keep all your website tracking codes in one place. 

Webmasters and marketers usually work with several codes such as Google Analytics snippets to track visitor data or Google Ads code to track advertising data. 

Similarly, there might be any third-party tracking codes to track particular user behavior on your website. 

Therefore, it becomes difficult to manage so many snippets scattered all around the source code. 

Finding and revising these codes is not easy, especially if you are not an IT person. This is where Google Tag Manager is so handy. It lets you keep all your tags together in one place and enables you to arrange them into containers. 

There is no programming expertise required to manage GTM tags, making GTM a powerful tool for anyone with a non-programming background.

In this article, I will discuss what GTMs are, the components of GTM and share some valuable tips to make the most of your GTM tag installation. 

Let’s begin! 

What is Google Tag Manager (GTM)?

Google Tag Manager is a tool that lets you deploy all the critical tags your business needs. With rule-based triggers and easy to use templates, you can manage tagging with as few lines of codes as possible. 

Once Tag Manager is installed on your website, you can establish triggers that cause your tags to fire once a specific event triggers.

For instance, if you wish the visitors to take a particular action on your website, such as clicking on the buy now button, completing the payment, and reaching the thank you page. When the visitors reach the thank you page, an event happens. Therefore, Tag Manager fires the event and shows this data in your Google Analytics dashboard. 

A collection of tags is called a container. The Google Tag manager container can keep all your tags from Google Analytics, Google Ads, Facebook, Floodlight, and any other third-party tags. 

Therefore, you can quickly deploy as many tags as possible on your website to track different events easily and accurately. 

Components of Tag Manager

Here are the different components of the Google Tag Manager:

  • Tag: It is a piece of code that sends data to the browser or tags platform.
  • Trigger: Tags are referenced to Triggers. When a specific event happens, like clicks or form submissions, an event occurs and tags that match the trigger definition are fired.  
  • Variable: A Variable is a placeholder for different values. 
  • Data layer: A Data Layer is a Javascript object to hold values used by tags, triggers, and variables. 

Where is Google Tag Manager placed on the website?

The Google Tag Manager snippet is placed after the opening <head> tag and after the opening <body> tag. 

Here is an example of the Tag Manager code snippet, which you should place right after the opening <head> and <body>  tags so that it can be used on your website’s pages. 


The importance of data layer

Data is essential for every business to track the success of their marketing campaigns. 

The Data Layer is a JavaScript object that passes data to the Google Tag Manager container. 

To create a data layer, you can add the below code in the <head> section of your website:


  dataLayer = [];


The data layer variables help Google Tag Manager read values from the data layer and pass the values to tags and triggers. 

An array is used for collecting and managing data in the data layer. Hence, it is crucial for your website because it offers a place to collect data as it is generated. 

It also helps measure the ROI of your PPC campaigns with data driven website conversions. 

Deploying the Google Analytics: G4 Configuration Tag on every page of your site

If you are already using Universal Analytics and created a Google Analytics 4 property, then you can also enable basic data collection using Google Tag Manager. 

Here are the steps to create a GA4 configuration tag:

Step 1: Click on Tags -> New.

Step 2: Now, click on Tag Configuration.

Step 3: Select Google Analytics: GA4 Configuration.

Step 4: Enter your measurement ID.

Step 5: Click Triggering and select the appropriate triggers you would want to fire.

Step 6: Save and publish your container. 

Google Tag Manager tips

Here are some of the best tips to follow when using GTM on your website: 

1- Use only one container tag per website

You should use only one GTM container tag per website because adding too many will make it difficult to diagnose issues in the future. 

It is easier to manage a website with a single container tag as it has all the tags used by the website. If you use several container tags, you might get confused as to which tag serves which purpose or trigger which events. 

Google also recommends having a single container tag per website. 

2- Ensure the GTM code is present on every page of your website 

To ensure that the GTM tracks and displays data correctly, you should place the code accurately on every page of your website. 

One of the easiest ways to check if the code is present on every page is by using the Screaming Frog SEO crawler. 

Copy your container’s GTM id and search it using the Custom search option using the Configuration menu in the Screaming Frog SEO tool. 


The tool will quickly find all the pages having the GTM id in them. 

3- Use GTM Workspaces for larger teams

A GTM Workspace lets you create multiple sets of changes for your container. 

Different team members can work independently in separate workspaces to test configurations if you have a large team. 

If you wish to test tag configurations separately from the main production tag, you should use the GTM Workspace. 

Keep changes small and group common changes together. Also, use version name and description to ensure you can remember the changes made easily.

4- Easily Track File Downloads

Universal Analytics does not allow you to track file downloads. But, you can track the file downloads easily with GTM. 

You can activate GTM’s built-in variable via a link click trigger.

You then need to enable Click-related variables, create a GA event tag and insert the Click URL variable.

It’s important to ensure that you set this tag to fire only when the pdf link is clicked. Once set up the data will be visible in your Google Analytics account. 

5- Organize your content via folders

You should organize a container’s tags, triggers, and variables into logical groups for easier management. For instance, you can manage your content by project, by team, or by type. 

When you organize by project, you can create a new folder for your new ad campaign or new microsite.

You can group by team when you have several teams working on the tags, such as your in-house marketing agency and the outsourced expert analytics firm. 

Finally, you can also organize your content by type, like one folder for managing Google Analytics tags and the other one for controlling Google Ads tags.

6- Keep the size indicator value below 70%

For optimal efficiency, Google recommends that the size indicator value should not exceed 70%. Therefore, you should not add too many tag configurations in every container. 

A size indicator appears in Tag manager in the versions pages. You can track the percentage, and if the value is more than 70%, you should take steps to clean the container. 

For instance, you can combine multiple similar tags into a single tag. Instead of creating five different tags that use a trigger to fire on five different pages, you can integrate them into a single tag that uses a lookup table variable.

7- Use constant variables to save time

If you have specific ids that you need to update in the future, it is better to store them as constant variables. 


For instance, you can keep the GA web property id as a constant variable to refer to the variable every time you have to create a new tag. 

Another example is the FB pixel tag. Suppose you have 20 pixel tags, and if you have to update the tags depending on your latest configuration, you will have to update all the 20 tags manually. 

Suppose you keep the pixel tag as a constant variable. In that case, you only need to update the variable and all the other tags that are calling the variable are updated automatically. Hence, this is a real time-savior. 


8- Use tag manager’s preview mode for testing triggers

You should always test your triggers with preview mode because often, if any of the scripts return a false, then the trigger code won’t run.

You can use the Tag Assistant Companion Chrome extension to troubleshoot the installation of tags.   

You can also click Preview in the top right of your workspace, enter your site’s URL, and click start to debug triggers. 


Final thoughts

Google Tag Manager is a robust tool for tracking different events via a small set of codes called tags. Instead of having too many tracking codes scattered all over your website, it is always better to have all the essential codes in a GTM container and debug or update them when needed. 

Apply the above Google Tag Manager tips to keep all your tracking data in one place and save loads of time. And yes, GTM is free to use, so there is no reason you shouldn’t use it. Happy tagging!