Google Tag Manager: A beginner’s guide

Google Tag Manager (GTM) is a tag management system that enables you to install and manage marketing and analytics “tags” on your website or mobile app without you having to change any of the code in the backend.

What are tags?

Tags are segments of code provided by analytics, marketing, and support providers to help you integrate their products into your websites or mobile apps. 

These small snippets of code go on to every page of your site or app to track how users behave and collect data to help you understand their actions.

Google Analytics 4, for example, uses a tag (known as ‘Google Tag’) to gather all the data that you can see in its reports. There are also tags for tools and platforms such as Pinterest, LinkedIn Insights, Facebook Ads, Google Ads, Hotjar (heat maps, surveys, and website analytics), or HubSpot – and many more!

Google Tag Manager acts as a bridge between your website/app and those third-party providers, so that you don’t need to manually apply tag codes.

Note: When we talk about tags in this context, we mean marketing and analytics tags. These are separate from the HTML tags used by web developers – such as <body>, <blockquote> or <li> – to tell web browsers how to display and format web content.

Google Tag Manager

What sort of behaviours and actions can tags help you track?

Tags can help you monitor actions such as:

  • When someone adds or removes items in the shopping cart
  • Shopping cart abandonment
  • Link or button clicks
  • File downloads
  • Form submissions
  • Sales
  • Video views
  • Scroll behaviour
  • Call to action performance
  • Custom events decided by you

Why should you use Google Tag Manager?

Google Tag Manager is used by 49.3% of all websites and holds a 99.7% share of the tag management system market.

Without a tag management system like Google Tag Manager, you would need to physically amend the code on your website to track user behaviour, ad performance, or any other type of digital marketing data compiled by a third party.

Every code change creates a renewed risk of breaking existing tags or conflicting with other web elements. This can impact how your site or app performs for visitors.

Google Tag Manager helps you protect your site from these risks by enabling you to run marketing tags from within its software rather than someone having to manually change the code on your site.

What are the benefits of using Google Tag Manager?

You can use Google Tag Manager with a fairly minimal amount of technical knowledge, which means that you don’t need to bring in a web developer every time you want to use a third-party analytics or marketing tool.

Google Tag Manager is designed to check how a tag performs before it is activated live on your website or app. It includes error-checking and debugging tools. It also creates and logs each new version of code, so if something does go wrong you can revert to an older version that you know worked without problems.

Other benefits include knowing that only authorised people can amend the tags on your site, and that multiple people in your team can work simultaneously in their own workspaces without overwriting one another’s work. This means you could have one person or team working on Google Analytics tags, while another is working on Google Ads tags.

If any tag conflicts were to be found for any reason, there are conflict resolution tools available.

This tag management system lets you set up things such as tag sequencing, so you can decide if you want tags to activate in a specific order.

All tags are scanned for malware and paused if any malware is detected.

How does Google Tag Manager work?

Rather than entering code for multiple tags on your website or app, Google Tag Manager works by adding a single JavaScript code snippet. This acts as a sort of box or “container” that holds the tags safely within but separate from your site.

When a visitor loads a page on your website, a “listener” in the Google Tag Manager code detects the visitor’s actions and determines whether this action triggers any of the codes within the container.

If it does – for example, if you have an analytics tag that has been told to monitor when a shopping cart is abandoned – Google Tag Manager activates the necessary code via its JavaScript container to run the tag and return the data you want to collect.

What is an event?

Before you use Google Tag Manager, it’s helpful to understand the terms/functions you might come across.

Tags activate in response to events. Events in Google Tag Manager are an action a user performs to interact with some component of your website. This could include a web page loading, a click on a link, a video being watched, a form being submitted, a purchase being made, or an app being installed as just a few examples.

Events are configured according to the tag type being used. Events tracked by Google Analytics 4 are configured via the Google Analytics: GA4 tag. Conversions events in Google Ads are sent with the Google Ads Conversion Tracking tag, and so on.

Some tags have automated events that they have already been set up to track. Google Analytics 4, for example, will track a number of different user actions without you having to tweak any of the settings. You can, of course, add additional Google Analytics 4 events.

What are triggers?

A trigger listens to your web page or mobile app for the specified events that tell a tag to fire. Every tag must have at least one trigger.

For example, Google Analytics 4 uses “page views” as a trigger, activating the Google Tag for every page the user visits.

You can assign multiple triggers (e.g. time spent on a page, video watched, link clicks, button clicks, form submissions, etc.) to a single tag.

Any time Google Tag Manager registers an event on your site, it checks the event triggers and activates the relevant tags.

You can read more about triggers and trigger types in the Tag Manager Help Centre.

What are variables?

Variables are criteria used to simplify, clarify, or automate tag configurations. Each variable is a named placeholder for a value that will change, such as a URL, date, price, or product name. This enables you to track behaviours such as link clicks during a set date range or interactions with a specific product page, for example.

Essentially, the process works like this:

  • An event happens on your site, e.g. Page views
  • The trigger type is Page view
  • The variable tells the trigger to only fire when someone makes a purchase and views the page example.com/purchase/receipt.html

Setting up Google Tag Manager

Before you can start using Google Tag Manager, you need to set up an account, then create a container and put the code for the container on your website.

I’m going to break this down into steps:

Step 1

Go to https://tagmanager.google.com/. If you’re not already logged into a Google account, you will be prompted to log in or set one up. You’ll then land on the Google Tag Manager home screen:

Google Tag Manager home screen - Create account

Click on Create account. This will take you to the following screen:

Add a new account

Step 2

Google recommends one Google Tag Manager account per business. If you’re setting the account up on behalf of your own business, then enter your business name in the Account Name field. If you are setting the account up for a client’s website or app, then enter their business name as you can manage multiple accounts from the dashboard.

Once you’ve entered the business name and location, you’ll need to give the container a name (remember, this is the short snippet of code that holds all the tags codes inside of it).

Google recommends using the web address for the website where the container will be used as the container name.

In most cases, you’ll probably be using Google Tag Manager to track web traffic, in which case you should select Web as the target platform. You’ll see that there are other platforms listed too for mobile apps and accelerated mobile pages.

Click Create.

A screen will pop up containing Google Tag Manager’s Terms and Conditions. Read them and select the tick box at the bottom of the screen to say that you accept the T&Cs, then click on Yes (appears in the top right corner of the screen on desktops).

Step 3

Now that your account and container have been successfully created, pop-up will appear that looks something like this:

Container code for Google Tag Manager

This is the code that will add the container to your website. Code 1 needs to be pasted as high as possible in the <head> section of every page of your website, while code 2 needs to be pasted immediately after the opening <body> tag.

Depending on which web content management system you use to create and maintain your website, you may not need to paste the code manually on every page. WordPress, Wix, Squarespace, HubSpot, and many others offer plugins or integration settings, which means you only have to copy and paste the code once and they will take care of distributing it throughout your site.

As it’s impossible to cover every website CMS here, I would recommend Googling how to set up Google Tag Manager on the platform you use. There are loads of fantastic walkthrough videos and guides out there.

If a web developer built a bespoke site for your business, you might need to ask them to deploy the container code for you.

Note: If you need to find the container code at any stage, click on the account ID in the Google Tag Manager workspace dashboard:

Google Tag Manager workspace dashboard

And that’s it – Google Tag Manager is now set up and the container is ready for whichever tags you choose to use.

Adding tags

Adding tags to Google Tag Manager

In the workspace dashboard, you can either click Tags in the left-hand menu, click on New Tag, or choose Add a new tag.

Tag Configuration

A slide-out screen will appear:

Tag Configuration

Click on Choose a tag type to being set up in the top Tag Configuration box.

A list will appear giving you a list of 50 different types of commonly used tags (you’ll need to scroll down the pop-up to see the full list):

Tag types

As you can see from the screenshot above, Google Analytics (one of the most common reasons to use the Google tag) is at the top of the list. With the Google Tag, you can set it up via Tag Manager or via Google Analytics 4, which you may already have seen in my Google Analytics 4 guide.

If you were previously using the global site tag (i.e. if you had previous versions of Google Analytics on your site), it will have been automatically converted to a Google Tag when Google Analytics 4 took over from Universal Analytics.

Click on the tag you want to set up and manage. The configuration steps will vary, depending on the tag you want to set up. With a Google Tag, for example, you will need the tag ID – Google has a guide to where to find this.

In fact, you will need a tag ID for any of the third-party platforms listed on Tag Manager. Each platform has its own guides to this process (here’s Pinterest’s version as another example).

Under the configuration for each tag, you will see a box called Triggering. This is where you need to set up at least one trigger to make the tag fire.

Triggering

Click on the Triggering box and you’ll be presented with a list of preset triggers from which to choose one or more. If you want to set up a different trigger, click on the plus sign that I’ve circled in red on the screenshot below:

Choose a trigger

You’ll be taken to a Trigger Configuration box. Clicking on it will bring up a list of trigger types, such as page views, all element clicks, just link clicks, scroll depth and many more. Once you click on a trigger, you can specify whether you want it to apply to all pages or just some. If you choose Just some, you can then set up variables.

Once you’re happy with the configuring of the information in the Tag Configuration and Triggering boxes, you can click the blue Save button in the top right corner.

If you want to, you can repeat the process with other new tags.

Verify the tags work

In the workspace dashboard, Google Tag Manager will track any changes that you have made in the Workspace Changes box.

To verify that the tags or any other changes work before you submit them, you can click on the Preview option in the top right of the screen. (near the Submit button).

preview and debug

Google Tag Assistant will then launch in a new tab.

You’ll need to enter the website URL on which you entered the Tag Manager Container.

When you do that, another tab/window will open with your website. In the Preview mode, you should see the word Connected

Connected in Preview and Debug mode

Also, at the bottom of your website’s window, you should see this (or something similar):

Debugger connected

As you continue navigating your site, if all is working as it should, you’ll see some events in Preview and Debug console at the bottom of your screen – this is a good sign.

If there are any errors, you can use the debugging function in the Tag Manager Assistant.

To edit a tag, click on the tag name to amend the settings. You can then run the Preview mode again to check that the new settings work.

Publishing your tags

Once you’re happy that the tags work in the Preview mode, click Submit on the top right (next to Preview).

The Submit Changes screen will appear with options to publish the container and save a version of the container. Google says to select the Publish and Create Version if it is not already selected.

You can then review the Workspace Changes information in your dashboard to check that it includes the new tags you’ve added. You can enter a version name and description in case you need to restore to this version at a later date. Then click Publish.

Learn more about Google Tag Manager

I’ve given you a beginner’s guide to Google Tag Manager today. For most people, the priority is to set up the Google Tag, which Google covers in detail here. As I’ve mentioned, there will be different steps to complete for non-Google integrations.

It is possible to use the Google Tag without setting up Google Tag Manager. Some people decide to do this if they’re only interested in using Google Analytics 4’s pre-set tracking events and triggers. Google has a guide to this here.

You can find guides to more in-depth aspects of using Tag Manager in Google’s Help Centre.

Want to get started with SEO? 

Download our SEO Checklist for 21 crucial SEO checks to help boost your Google rankings and increase your sales.

Need more support?

Get in touch with us today to schedule a consultation and take the first step towards digital success.

Whether you’re seeking ethical SEO services, comprehensive website audits, engaging blog writing packages, or targeted keyword research, SEO+ has you covered.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

SEO+