The filing cabinet and the drawer
In Level 1 we saw that numbers go wrong when tracking code is scattered across a site with nobody in charge of it. Google Tag Manager (GTM) gives that code one home. Before you add a single tag, you need to know how that home is laid out. Picture a filing cabinet:
- Account: the cabinet. Usually one per company, for example Acme Ltd.
- Container: a drawer for one website or app, for example test.acme.co.uk (Web). Its ID looks like
GTM-ABC1234. - Workspace: a desk where you lay out draft changes before anyone sees them.
- Version: a dated photocopy of the drawer's whole contents. Publishing puts one version live.
The last two are the safety net. Nothing you do in a workspace reaches visitors until you publish, and every publish leaves a version you can go back to.
Walkthrough 1: Create an account and web container
- Go to
tagmanager.google.comand sign in. - On the Accounts tab, click Create Account.
- Account Setup: enter the company name and country.
- Container Setup: name the container after the site's top-level URL, such as
test.acme.co.uk, and choose Web. - Click Create and accept the Terms of Service.
GTM then shows you the two-part install code. Copy both parts.
Walkthrough 2: Install both parts of the snippet
Both parts carry your container ID. Part 1 goes as high in the <head> as possible. Part 2 goes immediately after the opening <body> tag.
<!DOCTYPE html>
<html>
<head>
<!-- Google Tag Manager: PART 1, first thing in <head> -->
<script>(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],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-ABC1234');</script>
<!-- End Google Tag Manager -->
<!-- Placing it high means GTM starts loading early, so fewer visits slip past untracked -->
<title>Acme test site</title>
</head>
<body>
<!-- Google Tag Manager (noscript): PART 2, straight after <body> -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-ABC1234"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- Fallback for browsers with JavaScript turned off -->
<h1>Hello</h1>
</body>
</html>
If the site runs on a CMS such as WordPress or Shopify, use the platform's GTM integration or theme settings rather than pasting the code into every page.
Gotcha: put the snippet on every page, once. If a page template is missed, that page goes dark. If the snippet appears twice, every tag fires twice and your conversions double. We'll come back to both mistakes in later levels.
GTM-XXXX versus G-XXXX: which ID loads the container matters
You'll see several kinds of ID around Google's tools:
| ID | What it is |
|---|---|
GTM-ABC1234 |
Your Tag Manager container |
G-XXXXXXX |
A GA4 data stream (Google tag) |
AW-XXXXXXX |
A Google Ads account (Google tag) |
The distinction now has real consequences. The Tag Manager release notes (read 20 October 2026) record a change dated 9 July 2026. Some sites were loading their GTM container through the Google tag's paths (/gtag/js or /gtag/destination) rather than the normal gtm.js. Google treats those as unsupported installation paths. From that date, the ID used to load the container decides what is allowed:
- Loaded with a
GTM-ID: no restrictions. - Loaded with a product ID such as
G-orAW-: only Google-provided tags and variables run. Custom HTML and third-party templates, such as a Meta pixel, will not run.
Google says it emailed administrators of significantly affected containers. On your own sites, open DevTools → Network, filter for googletagmanager, and check that the request reads gtm.js?id=GTM-.... If you find a G- ID loading a container that holds custom tags, switch the site template to the GTM- snippet. Afterwards, look for duplicate hits.
Walkthrough 3: Workspace → version → publish → roll back
Create a workspace. Every container starts with a Default Workspace. To start a separate one, click the current workspace name at the top left, then + to add one, and name it after the job, for example ws-cookie-test. Standard (free) GTM allows three workspaces at once: the default plus two more. Tag Manager 360 has no limit.
Make a change and preview it. Add any small test item. Then click Preview, which opens Tag Assistant, and enter your test site's URL. Check that Tag Assistant shows your GTM- container as connected.
Publish a named version. Click Submit → Publish and Create Version, then fill in a real name and description:
Version name: v2 - test tag added for snippet check
Version description: Adds a test tag to confirm the container loads on
test.acme.co.uk. Requested by David, 20 Oct 2026.
Safe to remove.
GTM can now suggest a version name and description for you. Treat the suggestion as a first draft and add the why that only you know.
Best practice: "Version 7" with no description tells nobody anything six months later. When numbers jump, the first question is "what changed and when?", and good version notes answer it in seconds.
Roll back. Suppose v2 causes trouble. Go to Versions, open the Actions menu beside the last good version, and choose Set as Latest Version. This replaces your draft with that version's contents. It does not change the live site, so publish again and give the publish a name too, such as v3 - rollback to v1 (v2 broke checkout).
Gotcha: once one workspace publishes, every other workspace has to update to take in the new version before it can publish itself. GTM flags any conflicts and helps you resolve them.
Verify it
- Tag Assistant preview connects and shows
GTM-ABC1234. - The Network tab shows
gtm.js?id=GTM-ABC1234on every page template. - The Versions list shows your named versions in order, with the rollback version marked as live.
Key takeaways
- Account = company, container = one site (
GTM-ID), workspace = draft desk, version = snapshot. - Install part 1 high in
<head>and part 2 straight after<body>, on every page, exactly once. - Since 9 July 2026, a container loaded with a
G-orAW-ID runs only Google tags. Load it with theGTM-ID. - Nothing goes live until you publish. Give every version a clear name and description.
- To roll back, use Set as Latest Version and then publish.