Advertising & Marketing

Google Tag Manager: a beginner guide for marketers

Nicolas Finet Nicolas Finet 15 min read
Introduction to Google Tag Manager (GTM): A Beginner's Guide

Updated on 11 November 2026 by Nicolas Finet, CEO of Sortlist. We have rewritten this beginner's guide to Google Tag Manager (GTM): what tags, triggers and variables are, how a container works, how to set up GA4 and conversion tracking, how to test before publishing, how to use the data layer, how to manage versions and access, and what UK privacy rules mean for tracking (consent, PECR and Google's Consent Mode requirements). Interfaces and tag types change, so use Google's help centre for current screens. This is general information, not legal advice.

Google Tag Manager is a free tool that lets you add and manage measurement and marketing tags on your website or app from one interface, without editing the site's code each time. A tag is a snippet of code that sends data to another service: analytics, advertising platforms, heatmaps, affiliate networks or chat widgets. GTM keeps them organised, lets marketers publish changes quickly and provides testing and version control, although developer input is still needed for more advanced tracking.

Key takeaways

  • GTM has three building blocks: tags (what to send), triggers (when to send it) and variables (the values used).
  • Install the GTM container snippet once; then add and edit tags in the GTM interface, using preview mode to test before publishing.
  • Use a clear naming convention, versions and permissions so the container stays maintainable.
  • In the UK, non-essential cookies and similar technologies generally need consent. Tags must respect users' choices, and Google requires Consent Mode for some features in the UK and EEA.
  • Plan your measurement first (events, conversions, parameters), then build it in GTM.

Understanding tags and why they matter

Tag typeWhat it doesExample
Analytics tagsRecord visits and behaviourA GA4 configuration tag and event tags. See digital analytics
Conversion tagsReport completed goals to ad platformsA purchase or lead conversion for advertising campaigns
Remarketing tagsBuild audiences of visitors for later advertisingVisitors to product pages
Affiliate and attribution tagsCredit partners for salesNetwork tracking pixels
Event tagsRecord specific actionsButton clicks, video plays, form submissions, scroll depth
Site toolsSupport featuresHeatmaps, surveys and live chat

Without a tag manager, each tag usually needs a developer to change the site, which slows testing and risks errors. With GTM, you maintain a central container, reducing duplicate or broken tags and speeding up changes.

How Google Tag Manager works

ConceptMeaning
ContainerThe package of tags, triggers and variables for a site or app, installed by adding the container snippet to every page
TagA piece of tracking or marketing code that GTM fires
TriggerThe condition that tells a tag when to fire, such as a page view, click, form submission or custom event
VariableA value GTM can read or use, such as page URL, button text, order value or a data layer value
Data layerA structured object on the page that passes information to GTM, such as product or purchase data
Workspace and versionDraft changes and published snapshots of the container that you can compare and roll back

Getting started step by step

  1. Plan your measurement. List the actions that matter (leads, purchases, key clicks), the events and parameters you need and where they happen on the site.
  2. Create a GTM account and container for your website and add the two snippets to every page, or use your CMS integration if available.
  3. Add a GA4 configuration tag using your measurement ID, triggered on all pages, with consent settings applied. Our guide to custom GA4 reports shows how to use the data.
  4. Create event tags and triggers for form submissions, clicks, downloads or purchases, using built-in or custom variables.
  5. Test in Preview mode. GTM's preview and debug tools show which tags fire on which events. Test on desktop and mobile and use real journeys.
  6. Check in GA4 and ad platforms that events appear correctly, using real-time and debug views.
  7. Publish with a clear version name and description, so you can find and revert changes.
  8. Document and review. Keep a list of tags, owners and purposes and audit the container regularly.

Best practices for a clean container

  • Use naming conventions such as platform, type and purpose (for example "GA4 - Event - Form submit").
  • Use folders and descriptions to group tags and explain their purpose.
  • Prefer built-in variables and the data layer to fragile selectors that break when the site design changes.
  • Limit access. Give people the lowest permission they need; publishing rights should be restricted.
  • Avoid unnecessary tags. Every tag can slow pages and collect data. Remove ones you no longer use.
  • Use environments or workspaces for testing before publishing to the live site.
  • Keep third-party scripts under control. Vendors should be reviewed for security and privacy.
  • Review after site changes, redesigns and migrations, since selectors and URLs often change.

Tags can set cookies or read information from a user's device. In the UK, the Privacy and Electronic Communications Regulations (PECR) generally require clear information and consent for cookies and similar technologies that are not strictly necessary, and UK GDPR applies when personal data is processed. The ICO publishes guidance on storage and access technologies. The Data (Use and Access) Act 2025 amends parts of the cookie rules, including some limited exemptions for low-risk purposes, so check the ICO's current guidance rather than relying on older advice.

  • Consent management. Use a consent management platform (CMP) to show a clear banner and record choices. See consent management and cookieless marketing.
  • Respect choices in GTM. Configure tags so that those requiring consent fire only after the user agrees, using consent settings in GTM and your CMP integration.
  • Google Consent Mode. Sources report that since March 2024 Google has required Consent Mode v2 for advertisers using certain Google advertising and audience features with users in the EEA and UK. Check Google's current policy and its EU user consent documentation.
  • Data minimisation. Do not send personal data (such as email addresses or names) to analytics tools unless you have a lawful basis and a clear need.
  • Vendor terms. Ensure data processing agreements are in place with providers whose tags you use.

Sortlist editorial note: before launching a new tag, ask three questions: what decision will this data support, what data does it collect and does the user's consent choice allow it to run? If you cannot answer all three, do not publish it.

Sortlist editorial team

The data layer, explained simply

The data layer is a small block of structured information that your website places on the page so that GTM can read it reliably. Instead of scraping text from a button or the page URL, the site tells GTM exactly what happened and with which details: for example, that a purchase occurred, its value, currency and the products in the basket. This makes tracking more accurate and less likely to break when designers change the layout. For e-commerce, developers usually push events such as viewing an item, adding to basket, beginning checkout and purchase into the data layer, and you build tags and triggers in GTM that respond to them. Agree the event names and parameters with your developer before they build anything, and write them in a tracking plan that both teams can read.

A testing and debugging checklist

CheckHow
Does the right tag fire once?Use GTM Preview mode and look at the tags that fired on each event; watch for duplicates
Are the parameters correct?Inspect variables in the preview panel, such as value, currency and item names
Does the data appear in the destination?Check real-time or debug views in Google Analytics and your ad platforms
Does consent work?Test with consent denied and granted, and confirm tags behave accordingly
Does it work on mobile and in different browsers?Test on real devices and with common ad blockers or privacy settings
Did the site slow down?Compare page speed before and after, and remove heavy tags

Server-side tagging and the future of measurement

Standard GTM runs in the visitor's browser. Server-side tagging sends data to a server container that you control and then forwards it to vendors, which can improve control over what data leaves your site, help performance and make measurement more resilient to browser restrictions. It requires hosting, technical skill and ongoing cost, and it does not remove the need for consent: the same legal rules apply. Many organisations only need browser-based GTM; consider server-side tagging when you have significant paid media spend, complex tracking needs or strict data governance requirements. See also our guide to cookieless marketing.

Common GTM mistakes

  • Publishing without testing, leading to double-counted or missing conversions.
  • Installing the container twice or hard-coding the same tags in the site as well.
  • Firing tags before consent is given.
  • Poor naming that makes the container unmanageable.
  • Sending personal data to analytics or ad platforms.
  • Leaving old tags active after campaigns end.
  • Giving publishing permission to too many people.

When to involve a developer or specialist

Basic page-view and simple click tracking can often be set up by a marketer. You will usually need a developer for e-commerce data layer implementation, single-page applications, custom events from application logic and server-side tagging. A specialist can also audit an existing container for duplicate tags and consent issues. See our guides to analytics frameworks and customer journey analytics.

Frequently asked questions about Google Tag Manager

Is Google Tag Manager free?

Yes, the standard version is free. Some third-party services you add via tags have their own costs.

Do I need to know how to code?

No for basic use, but understanding HTML, the data layer and JavaScript helps for advanced tracking.

Does GTM replace Google Analytics?

No. GTM manages and fires tags; Google Analytics collects and reports the data.

Does GTM slow my site down?

The container itself is light, but the tags it loads can slow pages. Keep tags to what you need.

GTM itself is a loader, but many tags set cookies or collect data and need consent under UK rules. Configure your tags to respect users' choices.

Can I use GTM on a mobile app?

Yes, there are containers for apps, with different set-up steps.

Need help with tracking and analytics? Post your project on Sortlist and compare UK analytics and digital agencies for free.

Sources: Google Tag Manager Help, ICO, guidance on the use of storage and access technologies, iubenda, what is Google Consent Mode, Usercentrics, Consent Mode resources. Privacy rules and Google policies change; check current guidance.

Last updated:
Did you find this article helpful?
4.3 (47 ratings)

Rate this article:

More articles