
Google Tag Manager (GTM) is a free tag management system (TMS) that lets you add, update, and manage tracking scripts on your website without touching the underlying code. If you are starting from scratch, here is what to do first: Create a GTM account and container at Tagmanager Copy the two code snippets into your site's <head> and immediately after the opening <body> tag Enable Preview Mode before you publish anything, and confirm your tags fire correctly That is the skeleton. Everything below fills in the detail so you can go from a blank account to a working GA4 pageview tag, tested and live, without guessing. ***
Key takeaways
GTM is a delivery system, not an analytics platform: install two snippets, plan your tracking before you build, test in Preview Mode, and keep account ownership inside your organisation.
Point Details GTM is a delivery system It fires tags and sends data to destinations like GA4; it stores and reports nothing itself. Two snippets, correct placement Head snippet as high as possible in <head>; noscript iframe immediately after the opening <body> tag. Plan before you build Define events, agree naming conventions, and decide account ownership before opening GTM. Always use Preview Mode Verify every tag fires correctly in the debug pane before clicking Submit. Keep ownership internal Create the GTM account under your organisation's Google account and add agencies as users. Project-pixel builds it in Analytics and GTM setup are included in Project-pixel's fixed-price website builds, not added later.
***
What are the Google Tag Manager basics every beginner needs to know?
Google Tag Manager is a delivery system, not an analytics platform. It collects nothing on its own and stores no data. What it does is act as a container that sits on your site and fires scripts, called tags, when specific conditions are met. Those tags then send data to destinations like Google Analytics 4, Google Ads, or a heatmap tool.
The confusion between GTM and Google Analytics is one of the most common beginner mistakes. GA4 is where your reports live. GTM is the mechanism that gets the data there. You need both, but they do entirely different jobs.
Tags, triggers, and variables
GTM's three core concepts are worth understanding before you click anything:
A container is the wrapper that holds all of these. Best practice is one container per domain, though there are exceptions for multi-domain setups.
- 01Tags are the scripts that run on your site, for example a GA4 pageview tag or a Google Ads conversion tag.
- 02Triggers are the conditions that tell a tag when to fire, for example "fire on all pages" or "fire when a button with the class submit-btn is clicked."
- 03Variables are placeholders for dynamic values that tags and triggers can read, for example the current page URL, a click element's text, or a value pushed to the data layer.
GTM vs gtag.js vs direct script install
Approach Best for Trade-off GTM container Most sites; multiple tags to manage Requires snippet installation once; all changes made in GTM UI gtag.js (direct) Single Google product; simple sites Every change needs a developer and a code deploy Direct script install Third-party tools with no GTM template No central management; harder to audit
For almost any service business running more than one tracking tool, GTM wins. The one-time snippet install pays for itself the first time you need to add a tag without calling a developer.
***
Why planning your tracking before you build matters
The planning phase is where most GTM implementations go wrong, and it has nothing to do with the GTM interface. Google's own pre-install guidance is direct on this: define exactly what you want to measure before you open the GTM dashboard.
Start by listing the actions that matter to your business. For a service business, that typically means contact form submissions, phone number clicks, booking completions, and key page visits. Write these down as events with a name, a trigger condition, and the data you want to capture alongside them.
Naming conventions matter more than they seem. A tag called "GA4 Event" tells you nothing six months later. A tag called "GA4 Event - Contact Form Submit - Homepage" tells you everything. Agree on a format before you create your first tag: [Tool] [Type] - [Action] - [Location] works well and scales cleanly.
Decide who owns what. The GTM account should belong to your organisation, not your agency or freelancer. If an external team builds your container, they should be added as users, not the other way around.
Pro Tip: *Create the GTM account yourself and add your agency or developer as a user with the appropriate role. If you hand account creation to a third party and the relationship ends, recovering access can be slow and frustrating. Google recommends the organisation that owns the tags retains the account.*
***
How to create a GTM account and container
The developer documentation walks through this in detail, but here is the practical sequence:
GTM will immediately show you the two code snippets. Copy them now; you will need them in the next step.
Container type notes:
Access control from day one:
***
- 01Go to tagmanager.google.com and sign in with a Google account your organisation controls.
- 02Click Create Account. Name it after your company, not a project or campaign.
- 03Select your country.
- 04Under Container Setup, enter your website domain as the container name (e.g. yourdomain.co.uk).
- 05Select the appropriate target platform for your website.
- 06Accept the terms and click Create.
- 07Web covers standard websites and is the right choice for most beginners.
- 08iOS / Android are for native mobile apps.
- 09AMP is for Accelerated Mobile Pages.
- 10Server is an advanced option for server-side tagging, covered later.
- 11Add at least one other admin from your organisation so you are never the single point of failure.
- 12Use role-based access: give developers Publish rights, give content editors Edit rights only, and reserve Admin for the account owner.
- 13Never share login credentials; always add people as named users.
How to install the GTM snippets on your website
Installing GTM requires two separate code snippets, and placement is not optional.
Snippet 1 (JavaScript, goes in <head>): Paste this inside the <head> element of every page, as high as your platform allows. It loads the GTM library and enables tag firing for users with JavaScript enabled.
Snippet 2 (noscript iframe, goes in <body>): Paste this immediately after the opening <body> tag, if your platform allows. It provides a minimal fallback for users with JavaScript disabled, rendering a hidden iframe version of the container.
Both snippets must appear on every page of your site, not just the homepage.
CMS and platform installation
Pro Tip: *If your CMS does not allow direct <head> access, place the JavaScript snippet as early in the page as your platform allows rather than skipping it. The noscript iframe is a fallback for non-JavaScript environments; placing it in the wrong position (e.g. inside <head>) breaks it entirely. If you are unsure about your platform's constraints, the best website builders guide covers head-access limitations across common platforms.*
***
- 01WordPress: Use a plugin such as GTM4WP (Google Tag Manager for WordPress) or Insert Headers and Footers. GTM4WP places both snippets in the correct positions automatically and is the most reliable option for most WordPress sites.
- 02Shopify: Go to Online Store → Themes → Edit Code and paste Snippet 1 into theme.liquid inside <head>, and Snippet 2 immediately after <body>. Alternatively, use the Google & YouTube channel app, which handles the Google tag automatically.
- 03Wix: Use the Wix Marketing Integrations panel or the Custom Code section under Settings → Custom Code. Add Snippet 1 to the <head> and Snippet 2 to the <body>. Note that Wix restricts direct <head> access on some plans; check your plan level before starting.
How to set up your first tag: GA4 pageview and a click event
With the container installed, you are ready to create your first tag. The most useful starting point is a GA4 pageview tag, which records every page visit.
Creating a GA4 configuration tag (Google tag)
- 01In GTM, go to Tags → New.
- 02Click Tag Configuration and select Google tag.
- 03Enter your GA4 Measurement ID, found in GA4 under Admin → Data Streams → your stream → Measurement ID.
- 04Click Triggering and select Initialization - All Pages. This fires the Google tag before other tags load, which is the correct behavior for a configuration tag.
- 05Name the tag clearly: Google Tag - GA4 - G-XXXXXXXXXX.
- 06Click Save.
Adding a simple click event tag
Once the configuration tag exists, you can layer events on top of it.
Built-in vs user-defined variables:
Naming convention example: GA4 Event - CTA Button Click - All Pages. Consistent naming means anyone opening the container six months later can understand what each tag does without reading the configuration.
***
- 01Tag type: GA4 Event
- 02Event name: button_click (use snake_case; GA4 is case-sensitive)
- 03Trigger: Create a new trigger → Click - All Elements → set a condition such as "Click Classes contains cta-button"
- 04Variables used: Built-in variables like {{Click Text}} and {{Page URL}} let you capture what was clicked and where
- 05Built-in variables (Page URL, Click Element, Click Text, Form ID) are available under Variables → Configure and need only to be enabled, not created.
- 06User-defined variables are custom: a Constant variable for your GA4 ID, a Data Layer Variable for values pushed by your site, or a JavaScript variable for anything else.
How to use Preview Mode to test before you publish
Never publish a container without testing it first. Preview Mode, powered by Tag Assistant, is the tool for this, and using it before every publish should become a habit.
To enter Preview Mode, click Preview in the top-right of the GTM workspace. A new browser tab opens your website with a debug pane at the bottom. Every event that fires appears in the left-hand panel; clicking an event shows which tags fired, which did not, and the values of every variable at that moment.
Debug checklist before publishing:
Test on multiple pages, not just the homepage. If your site has a contact page, a services page, and a blog, open all three. Also test with your consent banner active if you have one, because consent settings can block tags from firing.
***
- 01Confirm the GA4 configuration tag fires on the Initialization event (it should appear at the very top of the event list).
- 02Load two or three different pages and confirm the pageview tag fires on each.
- 03Trigger the click or form event you configured and verify it appears in the event list with the correct tag status (Fired, not Not Fired).
- 04Check variable values: click the event, open the Variables tab, and confirm {{Click Text}} or {{Page URL}} returns what you expect.
- 05If a tag shows Not Fired, check the trigger condition first. The most common cause is a mismatched CSS class or an incorrect trigger type.
How to publish your container and verify data in GA4
Once Preview Mode confirms everything works, publishing takes under a minute.
Publish checklist:
GTM uses version control automatically. Every time you publish, a new version is created. If something breaks, go to Versions, find the previous version, and click Set as Latest to roll back instantly.
Verifying data in GA4:
If Realtime shows no data after five minutes, return to GTM Preview Mode and confirm the tags are firing. The most common culprits are a missing or misplaced snippet, a consent block, or a GA4 Measurement ID with a typo.
***
- 01Click Submit in the top-right of GTM.
- 02Choose Publish and Create Version.
- 03Give the version a short, descriptive name: v1 - GA4 pageview + CTA click event.
- 04Add a brief note explaining what changed. This takes 30 seconds and saves hours of confusion later.
- 05Click Publish.
- 06Open GA4 and go to Reports → Realtime. Within a few seconds of visiting your site, you should see active users appear.
- 07For event-level verification, go to Configure → DebugView in GA4. This shows individual events as they fire, including parameter values.
- 08Full data processing in GA4 standard reports can take up to 24 hours, so do not panic if the Events report looks empty immediately after publishing.
Practical starter tags to add after your first setup
Once the GA4 pageview tag is live, these are the most useful tags to add next, roughly in priority order for a UK service business:
The form submission tag delivers the most immediate business value. Without it, you cannot tell whether your website is generating enquiries, which makes every other marketing decision harder.
***
- 01GA4 event - form submission: Track every contact or enquiry form. Use a trigger on the Thank You page URL or a form submission trigger to track form submissions.
- 02GA4 event - phone number click: Fire when a user clicks a tel: link. Use a Click URL trigger containing tel:.
- 03Google Ads conversion tag: Required if you run Google Ads. Tracks which ad clicks lead to enquiries or purchases.
- 04Google Ads remarketing tag: Builds audience lists so you can retarget site visitors. Pair it with a consent check.
- 05Custom HTML tag for live chat: If you use a chat widget (Tidio, Intercom, or similar), a Custom HTML tag lets you load it via GTM and control when it fires.
- 06Heatmap or session recording tag: Tools like Microsoft Clarity have a GTM template in the tag gallery. Add it early; the data becomes more useful the longer it runs.
Migrating from gtag.js to GTM: your options
If your site already has a gtag.js snippet installed directly in the code, you have three paths forward.
Checklist to avoid double-counting:
***
- 01Full migration: Remove the gtag.js snippet from your site code and manage everything through GTM. This is the cleanest approach and avoids any risk of duplicate hits. After removing the direct snippet, recreate your tags inside GTM and test thoroughly in Preview Mode before publishing.
- 02Phased migration: Move tags into GTM one at a time while leaving the direct snippet temporarily. This reduces risk but requires careful ID management to prevent double-counting. If both the direct snippet and a GTM-managed tag share the same GA4 Measurement ID, every pageview will be counted twice.
- 03Coexistence for specific use cases: Some developers leave gtag.js in place for a single purpose (e.g. a specific conversion event tied to a CMS plugin) and use GTM for everything else. This works, but only if the IDs are different or the direct tag fires on a completely separate event.
- 04Search your site's source code for your GA4 Measurement ID (G-XXXXXXXXXX). If it appears both in a direct script and in GTM, you have a duplication problem.
- 05In GTM Preview Mode, check the GA4 Network tab in your browser's developer tools and count how many hits fire per page load.
- 06Remove duplicate tag IDs before publishing the GTM container.
GTM and privacy: what you need to know for UK compliance
GTM does not handle legal consent. It is a delivery mechanism, and by itself it will fire every tag on every page load regardless of what a user has chosen. Under UK GDPR and PECR, marketing and analytics cookies generally require prior consent before they are set.
The practical solution is a Consent Management Platform (CMP) such as Cookiebot, OneTrust, or a similar tool. The CMP captures the user's consent choice and writes it to the browser. GTM can then read that consent state and use it to block or allow specific tags.
How to gate tags in GTM:
Pro Tip: *Never assume a tag is blocked just because a CMP is installed. Always verify in GTM Preview Mode with consent declined. A misconfigured trigger can cause marketing tags to fire before consent is given, which is a PECR compliance risk. This is general guidance, not legal advice; consult a qualified professional for your specific situation.*
Keep analytics tags (GA4) and marketing tags (Google Ads, remarketing) in separate trigger groups so you can block one category without affecting the other.
***
- 01Use GTM's built-in Consent Initialisation trigger type for tags that need to check consent before firing.
- 02Set Consent Settings on individual tags (available in the tag configuration panel) to require specific consent types such as analytics_storage or ad_storage.
- 03Test your consent flow in Preview Mode: decline all cookies, reload the page, and confirm that marketing tags show as Not Fired.
Common GTM mistakes and best practices
Most GTM problems come from a small set of recurring errors. Here is what to watch for.
Best practices:
Common issues and quick fixes:
Access control reminders:
***
- 01Use consistent naming conventions from day one. Changing them later means renaming dozens of tags.
- 02Write a short version note every time you publish. "Added form submit event" is enough.
- 03Use the data layer for any business-critical values (order totals, product IDs, user types). DOM scraping, where GTM reads values directly from page elements, breaks whenever a developer changes the HTML.
- 04Keep the account under your organisation's Google account, not a personal Gmail.
- 05Tag not firing: Open Preview Mode, click the relevant event, and check the Triggering tab. The trigger condition is almost always the cause. Check CSS classes, URL patterns, and element IDs carefully.
- 06Variable returning undefined: The variable is reading something that does not exist on the page. Check the selector or data layer key name for typos.
- 07Missing snippet: If no tags fire at all, check that both GTM snippets are present on the page using your browser's View Source. A plugin or theme update can sometimes remove custom code.
- 08Duplicate events in GA4: You have the same tag firing twice. Check for both a direct gtag.js install and a GTM-managed tag with the same Measurement ID.
- 09Add at least two admin users so the account is never locked to one person.
- 10Review user access every six months and remove anyone who no longer works on the account.
- 11Never give an external agency Admin-level access; Editor or Publish is sufficient for most agency tasks.
What to learn and do next after your basic GTM setup
With a working pageview tag and one event live, the natural next steps build on that foundation.
When to bring in a professional: if you need a custom data layer for e-commerce transactions, if you are managing tags across multiple domains, or if server-side tagging is on the roadmap, the complexity rises quickly. At that point, the risk of getting it wrong outweighs the cost of getting it right with help.
***
- 01Validate events in GA4: Go to Configure → Events in GA4 and mark your form submission event as a conversion. This unlocks conversion reporting across all your channels.
- 02Create audiences: In GA4, build audiences based on the events you are now tracking (e.g. users who submitted a form, users who visited a pricing page). These feed into Google Ads remarketing.
- 03Set up additional conversion goals: Add phone click events, booking completions, and any other high-value actions as GA4 conversion events via GTM.
- 04Consider server-side tagging: When performance, data accuracy, or ad-blocker resilience becomes a priority, server-side tagging moves tag processing off your website to a cloud server. It is an advanced step, but worth understanding early.
- 05Review your deployment process: A structured website maintenance plan that includes GTM version checks prevents tracking from breaking silently after site updates.
When to do GTM yourself and when to call Project-pixel
Most service businesses can handle the basics covered in this guide without professional help. If your site is on WordPress, Shopify, or Wix, you have a single domain, and you need GA4 pageviews plus a handful of conversion events, the DIY route is entirely reasonable.
The picture changes when complexity enters the equation. Here are the indicators that professional setup is worth the investment:
Project-pixel's 7-stage website process includes analytics and tracking setup as a standard part of every build, not an afterthought. For businesses that want a clean, well-structured implementation without spending hours in the GTM interface, that is the practical alternative to DIY.
***
- 01You need a custom data layer for e-commerce, booking systems, or CRM integrations.
- 02Your site spans multiple domains or subdomains that need cross-domain tracking.
- 03You are running Google Ads and need accurate conversion data for bidding strategies.
- 04You have inherited a messy GTM container with dozens of unnamed tags and no version history.
- 05You need server-side tagging for performance or privacy reasons.
- 06You want analytics built into a new site from day one, not bolted on afterwards.
What Project-pixel can do for your GTM and analytics setup
Fixed-price web design that includes proper analytics from the start is what Project-pixel does for established service businesses across the UK. Rather than leaving GTM as a task for later, it is built into the delivery process.
Here is what a typical engagement covers:
If you are building a new site or inheriting one with no tracking in place, the web design services page is the right starting point. You can also browse industry-specific packages to see how analytics setup fits into a full site build for your sector.
***
- 01GTM account creation under your organisation's Google account, with role-based access configured from day one.
- 02Container build with GA4 pageview, key conversion events (form submits, phone clicks, booking completions), and Google Ads tags where needed.
- 03Data layer specification and implementation for any custom tracking requirements.
- 04GA4 validation in DebugView and Realtime before handover.
- 05Consent configuration so marketing tags are gated correctly under UK GDPR and PECR.
- 06Ongoing support so tracking does not break silently when the site is updated.
Sources
***
FAQ
Can you explain Google Tag Manager in a simple way?
GTM is a container that sits on your website and fires tracking scripts, called tags, when specific conditions are met. It sends data to tools like GA4 but stores nothing itself.
Is Google Tag Manager easy to learn?
The basics, creating an account, installing snippets, and setting up a GA4 pageview tag, are straightforward for most beginners. More advanced features like custom data layers and server-side tagging require developer knowledge.
What are the fundamentals of Google Tag Manager?
The three fundamentals are tags (scripts that run on your site), triggers (conditions that tell a tag when to fire), and variables (placeholders for dynamic values). A container holds all three and is installed on your site via two code snippets.
Is Google Tag Manager still relevant in 2026?
Yes. GTM remains the standard way to manage multiple tracking scripts on a website without repeated code deployments. Server-side tagging, which runs through GTM's server container type, is growing in adoption for performance and privacy reasons.
Do I need Google Analytics if I have Google Tag Manager?
Yes. GTM delivers data but does not report on it. You need a destination like GA4 to see reports, audiences, and conversion data. GTM and GA4 work together, not instead of each other.