Google Tag Manager (GTM)

Google Tag Manager, or GTM, is a free tool from Google that keeps a website's tracking tags in one container. The container's code goes on the site once. After that, tags can be added, changed, or paused in Tag Manager, usually without a developer editing the site each time.

How Google Tag Manager decides when a tag fires

Every tag in GTM has a trigger, which is the rule for when it runs. A trigger might be a page loading, a button being clicked, or a form being sent.

Take an enquiry form. If the trigger waits for a successful submission, a form that comes back with errors doesn't count, so nothing is sent. When the form goes through properly, the trigger fires. The tag then sends a generate_lead event to Google Analytics, and it's recorded as one lead. That way, each real enquiry is counted once, however many times someone presses the button.

What sits inside a Tag Manager container

A container holds three kinds of thing. Tags are the pieces of code that send data somewhere, such as a Google Analytics event, a Google Ads conversion, or a Meta pixel. Triggers decide when each tag runs. Variables hold the details that tags and triggers need, like the page address or the ID of a form.

Alongside these sits the data layer. It's a list of facts the website hands to Tag Manager, such as the type of page or the product someone is looking at. Tags can use those facts without having to dig them out of the page.

Testing GTM changes before they go live

Tag Manager has a preview mode that opens your site with a panel showing which tags fired on each click and page. It's worth using every time, as a trigger that's slightly too broad can count every click as a lead. Each published change is saved as a version, so you can go back to an earlier one if something breaks.

Consent matters too. In the UK, tags that set cookies for analytics or advertising should usually wait until a visitor agrees, and GTM's consent settings can hold them back until then. Adding the container on its own doesn't give you reliable tracking. Each event still has to be planned, set up, and tested.

Google Tag Manager on a turbo supplier's blog

These lines are copied from a guide on the Essex Turbos website, where the page fills the data layer before the GTM container loads.

  1. Before the container loads, the page adds a few facts about itself to the data layer. It says the page is a single blog post, that it sits in the guidance category, and who wrote it. The standard Tag Manager snippet then loads the container, and any tag inside it can read those details. A page view tag could send the category along with it, for example, so guides can be reported on apart from product pages.

    Essex Turbosessexturbos.com/what-does-a-turbo-actuator-do/
    var dataLayer_content = {"pagePostType":"post","pagePostType2":"single-post","pageCategory":["guidance"],"pagePostAuthor":"Essex Turbos"};dataLayer.push( dataLayer_content );…(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],…

    Read from the live page on 17 November 2026.

More analytics glossary terms

These analytics glossary terms explain how website visits, events, campaigns and sales are measured, and where the numbers can mislead. Each definition comes with a diagram and a practical example, so reports from Google Analytics and other tools are easier to read and question.