Back to guides
guides

How To Set Up Google Tag Manager

If you are running any kind of digital marketing activity, whether that is Google Ads, paid social, or simply trying to understand how visitors behave on your website, then getting Google Tag Manager...

July 17, 2026
9 min read
How To Set Up Google Tag Manager

If you are running any kind of digital marketing activity, whether that is Google Ads, paid social, or simply trying to understand how visitors behave on your website, then getting Google Tag Manager set up correctly is one of the most important foundations you can put in place. It is one of those tools that, once you understand what it does and how it works, you will wonder how you ever managed without it. For those that are new to it, Google Tag Manager (GTM) is a free tag management system that allows you to deploy and manage marketing and analytics tags on your website without needing to edit the site's code every single time. This saves an enormous amount of time and reduces the dependency on developers for what are, in most cases, relatively straightforward tracking requirements.

This guide will walk you through how to set up Google Tag Manager from scratch, connect it to your website, and begin using it to manage your tracking in a structured, reliable way.

What Is Google Tag Manager and Why Does It Matter

Before diving into the setup process, it is worth understanding what GTM actually does and why it has become such an essential part of the modern marketer's toolkit. A tag, in this context, is a snippet of code or a tracking pixel that you place on your website to collect data or trigger a specific action. Examples include the Google Analytics tracking code, the Google Ads conversion tracking tag, or a Meta Pixel for Facebook and Instagram advertising.

Without a tag manager, every time you want to add or update one of these tags, someone has to go into the website's code and make changes manually. This creates delays, introduces the risk of errors, and places unnecessary pressure on development teams. GTM solves this by acting as a container that sits on your site. Once the container is installed, you can add, edit, and manage all of your tags from within the GTM interface, with no further code changes required on the site itself. For anyone serious about conversion tracking and data collection, this is a genuinely transformative way of working.

Creating Your Google Tag Manager Account

The first step is to create your GTM account. Head over to tagmanager.google.com and sign in using a Google account. It is worth using the same Google account that is connected to your other Google properties, such as Google Analytics and Google Ads, as this makes linking them together considerably more straightforward later on.

Once signed in, click the option to create a new account. You will be prompted to give your account a name, which is typically your business or organisation name, and then to set up a container. The container is essentially the wrapper that will hold all of your tags for a specific website or app. Give the container a descriptive name, often the domain name of the website works well here, and select the target platform. For most users setting up GTM for a website, you will want to select Web.

After agreeing to the terms of service, GTM will generate your container and immediately present you with the installation code. This is the most important part of the entire setup process, so take care here.

Installing the GTM Code on Your Website

Google Tag Manager provides you with two separate code snippets that need to be placed on every page of your website. The first is a JavaScript snippet that should be placed as high as possible in the opening <head> tag of your pages. The second is a <noscript> snippet that should be placed immediately after the opening <body> tag. Both are important and both should be installed correctly.

Want more insights like this?

Join thousands of marketers getting weekly tips and strategies.

If you are using a content management system such as WordPress, there are several plugins that make this process simple, with GTM4WP being one of the most widely used and reliable options available. If you are on a platform such as Shopify or Squarespace, both platforms have native integrations or specific guidance for adding GTM, so it is worth consulting their respective documentation to ensure the code is placed correctly.

For those with a custom-built site, the code will need to be added directly to the site's template files. This is typically a job for a developer, but it is a one-time task. Once the container code is on the site, everything else is managed from within GTM itself.

After installation, you can verify that GTM is firing correctly by using the Preview mode within the GTM interface. Enter your website's URL and GTM will open a debug panel at the bottom of your browser showing you exactly what tags are firing and when. This is an incredibly useful feature and one you will come back to time and again when troubleshooting tags further down the line.

Understanding Tags, Triggers, and Variables

Google Tag Manager operates around three core concepts: tags, triggers, and variables. Understanding how these three elements work together is the key to getting the most out of the platform.

A tag is the piece of code or tracking pixel you want to fire on your site. This could be a Google Analytics configuration tag, a Google Ads conversion tracking tag, or any number of third-party scripts.

A trigger is the condition that tells GTM when to fire a tag. For example, you might want a tag to fire when someone visits a specific thank-you page after completing a purchase, or when a button is clicked, or when a form is submitted. The trigger defines that moment.

A variable is a value that GTM can reference when evaluating triggers or configuring tags. For instance, the current page URL is a variable, and you might use it within a trigger to fire a tag only when the URL contains a specific string, such as /thank-you.

Once you understand how these three elements interact, building and managing tags becomes a logical, repeatable process rather than a technical challenge.

Setting Up Google Analytics Via GTM

One of the most common reasons businesses set up Google Tag Manager is to deploy Google Analytics 4 across their website. Rather than pasting the GA4 code directly into the site, GTM gives you far greater control over how and when the tag fires.

Within GTM, navigate to Tags and create a new tag. Select Google Analytics as the tag type, then choose Google Tag and enter your GA4 Measurement ID, which you will find within your GA4 property settings. Set the trigger to All Pages, which means the tag will fire on every page of your website, and then save the tag. Once you have published the container, your GA4 data will begin flowing through.

This same approach can be used to deploy the Google Ads conversion tracking tag. Create a new tag, select Google Ads Conversion Tracking as the type, enter your Conversion ID and Conversion Label from your Google Ads account, and set the trigger to fire on your confirmation or thank-you page. This is how GTM becomes a cornerstone of effective conversion tracking, giving you clean, reliable data on which campaigns, keywords, and ads are genuinely driving results for your business.

Publishing Your Container

One thing that catches a lot of people out when they first start using GTM is the fact that changes do not go live until you explicitly publish them. Within GTM, everything you do is saved as a draft until you choose to submit and publish a new version of the container. This is actually a very sensible approach because it means you can build and test multiple tags, review them in Preview mode, and only push them live when you are confident everything is working as expected.

To publish, click the Submit button in the top right corner of the GTM interface. You will be asked to give the version a name and a description, which is good practice for keeping a clear record of what changed and when. Once published, the changes will be live on your website within minutes.

Keeping Your GTM Container Organised

As your use of GTM grows, it is surprisingly easy for the container to become cluttered with outdated tags, duplicated triggers, and variables that nobody can remember the purpose of. Adopting a clear naming convention from the very beginning will save you a significant amount of time and confusion later on. A sensible approach is to name tags in a way that describes their function and the platform they relate to, for example, GA4 - Page View or Google Ads - Purchase Conversion. This makes it immediately clear what each tag does and means that anyone else working in the account can navigate it without needing a full briefing.

It is also worth regularly auditing your container to check for tags that are no longer needed. Unused tags that continue to fire unnecessarily can slow your site down and create noise in your data, neither of which serves your marketing efforts.

Getting The Most From Google Tag Manager

Google Tag Manager is not simply a tool for deploying your analytics and conversion tracking tags, though it does both of those things exceptionally well. It is a platform that, when used thoughtfully, gives marketers genuine control over their data collection, reduces reliance on development resource, and creates a much cleaner, more manageable approach to tracking across the board.

Taking the time to set it up correctly from the start, understanding how tags, triggers, and variables work together, and keeping your container organised are the habits that will serve you well as your digital marketing activity grows. Whether you are managing a single website or multiple properties across different brands, GTM is one of those tools that belongs at the heart of how you work. The setup process itself is not complex, but the returns it delivers in terms of data quality, tracking reliability, and marketing agility are considerable.

I

Ian

Ian has worked in Digital Marketing for decades, and is a Google Partner for Google Ads and an expert in onsite and technical SEO. He has worked with hundreds of clients, helping them achieve success online, through SEO, PPC and Digital Marketing, working with local businesses through to national retailers.

View all posts →

Related Articles