The HoldTo1 Journal
RSS & publishing

What Is Google Tag Manager and How to Use It

Google Tag Manager lets a small business add tracking to its website without touching code every time. This guide explains tags, triggers and variables in plain English, then walks through setup, testing and the first events worth tracking.

The queue of little code jobs that never ends

Picture a florist with a website. She wants to know how many visitors tap the phone number on her contact page, how many reach the order form, and how many actually send it. Each of those questions is a small piece of code, and in the old way of doing things each one means the same routine: ask the person who built the site, wait for a gap in their diary, pay for an hour of their time, and hope nothing else breaks while they are in there.

After the third or fourth request, most small businesses stop asking, and the owner keeps guessing which pages earn their keep. Tag Manager breaks that routine: it holds every tracking code for a website in one place, and the owner adds, changes or removes them from a screen in a browser, with the site’s own code touched only once, at the very start.

What Google Tag Manager actually is

Google Tag Manager is a free tool from Google that holds all the tracking codes for a website in one place. Those codes are called tags, and each one sends information somewhere: to Google Analytics, to Google Ads, to a Facebook pixel, to any other tool that measures what visitors do. Instead of pasting each tag into the site’s files, you put them all inside Tag Manager, which decides when each one runs.

The site itself carries only one small piece of code, the container snippet. Once that is in place, everything else — adding a tag, changing when it fires, removing one that is no longer needed — happens inside Tag Manager’s own screens, without opening the website’s files.

One thing it is not: analytics. Tag Manager collects no reports and draws no charts — it is the delivery system, and Analytics is the tool that turns the data into reports.

Tags, triggers and variables: the three moving parts

The pieceWhat it doesA small-business example
TagCode that sends information to a tool when it runs.A Google tag sending page views to Analytics 4.
TriggerThe condition that decides when a tag runs.A trigger firing only when a visitor clicks “Get a quote”.
VariableA named value Tag Manager can hand to a tag or trigger.The page address, or the text on the button clicked.

Everything in Tag Manager is built from three kinds of item. Once you can tell them apart, the rest of the tool makes sense.

A tag is code that sends information to a tool when it runs — for example a Google tag sending page views to Analytics 4. A trigger is the condition that decides when a tag runs — for example a trigger firing only when a visitor clicks “Get a quote”. A variable is a named value Tag Manager can hand to a tag or trigger — the page address, or the text on the button clicked.

The three work as a team. The trigger watches for something to happen, the variable supplies the detail — which page, which button, which form — and the tag sends that detail to the tool that needs it. A tag with no trigger never runs, and a trigger with no tag runs nothing.

Tag Manager comes with built-in triggers for the common cases — a page loading, a link clicked, a form sent, a visitor scrolling — and most small businesses never need anything fancier than those.

Naming is the quiet habit that decides whether a container stays usable: a tag called “GA4 — page views” tells the next person what it is, while “Tag 7” tells them nothing. Decide on a pattern before the container fills up — tool first, then what it does — and keep to it.

Hands writing a checklist on a paper notepad beside a laptop and a cup of coffee on a wooden café table.

The data layer: the tidy shelf your site keeps for Tag Manager

Underneath tags, triggers and variables sits one more idea: the data layer. In plain terms, it is a JavaScript object on the page — called dataLayer unless renamed — that the website uses to hand facts to Tag Manager, dropping in messages such as “a form was sent” or “an order worth £42 was placed”.

Tag Manager watches a special key inside those messages, called event. When a message carries an event, Tag Manager treats it as a signal and can fire tags in response. Values in the data layer can also be read through data layer variables, so a tag can send the order value or the service booked along with the event.

For most small businesses, the data layer is something the developer or the website platform sets up once, to pass order or booking details. Day to day you will work with the built-in triggers and variables instead.

Tag Manager against editing the site code yourself

The jobEditing the site code each timeWith Tag Manager in place
Add Google AnalyticsPaste the snippet into every page template, or wait for a developer.Add one tag in Tag Manager, test it in preview, publish.
Fix a mistake in a tagOpen the files again, edit, and check nothing else moved.Change the tag, test it in preview, publish a new version.
See what actually firedBrowser tools and guesswork.Preview lists the tags that fired, in order, with their data.
Who can make the changeWhoever has access to the site's code.Anyone with the right access to the container.
Undo a bad changeRestore a backup of the site.Open the earlier version and publish it again.

Is Tag Manager worth the afternoon it takes to set up, when pasting a snippet takes five minutes? It depends on how often things change: a site that will never need more than one analytics tag does not need it, while a site whose owner keeps thinking of new things to measure does.

Adding Google Analytics: editing code each time means pasting the snippet into every page template, or waiting for a developer; with Tag Manager, add one tag, test it in preview, publish. Fixing a mistake in a tag: editing code means opening the files again and checking nothing else moved; with Tag Manager, change the tag, test it in preview, publish a new version. Seeing what actually fired: with code, browser tools and guesswork; with Tag Manager, Preview lists the tags that fired, in order, with their data. Who can make the change: with code, whoever has access to the site’s code; with Tag Manager, anyone with the right access to the container. Undoing a bad change: with code, restore a backup of the site; with Tag Manager, open the earlier version and publish it again.

Tag Manager does not make developers unnecessary — installing the snippet is a code change, and data layer work is a developer’s job. What it removes is the queue: once the snippet is in, each new tracking idea no longer waits for a code release. That is the whole point, and the reason a small business with no developer on staff gets more out of it than a large team.

Setting it up: account, container and the snippet

Setup has three stages, in this order: create the account and container, put the snippet on the site, then add the first tag. Allow an afternoon — the snippet needs a container to point at, and the tag needs the snippet live.

First, the account. Go to tagmanager.google.com and sign in with a Google account. Open the Accounts tab and choose Create Account. The form asks for an account name — the business name is the usual choice — and a country, and an optional box for sharing data anonymously for benchmarking.

Next, the container. In the same form, under Container Setup, give the container the site’s top-level address, such as www.example.com. One container covers the whole site, and a second website gets a second container under the same account. Then pick the kind: Web, for a website or web app, or iOS, Android, AMP or Server. Click Create and accept the Terms of Service.

Then the snippet. In the Workspace tab, click the container ID — it starts with “GTM” — or the “Install Tag Manager” card. On a website builder such as WordPress, Shopify or Wix, choose “Select your platform” and follow the guided steps. Otherwise choose “Install Manually”, copy the single block of code, and paste it near the top of the head of every page.

Two things about that snippet are worth knowing. First, it is one block now: older guides show two parts, a script in the head and a noscript frame after the opening body tag, and sites already using that form do not need to retag — Google’s help page says their containers keep working. Second, the install dialog has a Test box: enter the site’s address and click Test to confirm the snippet is in place.

Connecting Google Analytics 4 through Tag Manager

With the snippet live, the first tag most businesses add connects Google Analytics 4. Three things need to exist first: a GA4 account and property, a web data stream for the website, and the Tag Manager setup above — plus access to the container and the Editor role or above on the Analytics account.

Google’s help page offers two routes to the same result. The recommended one uses the Google Analytics Destination: choose Add Tag, open Tag Configuration, pick Google Analytics, then Google Analytics, and enter the Tag ID. The other route picks the Google Tag type instead and enters the same Tag ID. Either way, set the triggering to Initialization — All Initialization Events, so the tag runs as early as possible on every page, then save.

That tag loads the Analytics property on the page, sets out the common settings for Analytics tags, sets the Analytics cookies, and sends the events Analytics collects on its own — the automatically collected events and the enhanced measurement events. That is why, once the Google tag is live, basic page views and scrolls start appearing in Analytics without further work.

Two rules keep this part clean. First, one Google tag per website: Google’s page says to create a unique Google tag for each website, and a second copy on the same site will double-count visits. Second, if the site already has Analytics code pasted into it directly, remove it — the hard-coded snippet and the Tag Manager tag will both report the same visits, and the reports will be wrong in a way that is hard to spot later.

The first events worth tracking

EventWhat it tells the businessHow it is usually set up
Newsletter signup clickWhich pages bring new subscribers.GA4 Event tag, click trigger on the signup button.
Contact form sentHow many enquiries the site produces.GA4 Event tag, Form Submission trigger set to fire only on a successful send.
Phone number tapHow many visitors try to call from the site.GA4 Event tag, click trigger on the telephone link.
Scrolling to the endWhether visitors read a long page.Already recorded by enhanced measurement; check Analytics before building a tag.
Brochure or price-list downloadWhich documents visitors take away.Already recorded by enhanced measurement.
Outbound link clickHow many visitors leave for a booking partner.Already recorded by enhanced measurement; a custom tag adds the destination.

Page views tell a business how many people arrived, and nothing about what anyone did. Events fill that gap — the enquiries, the signups, the phone taps, the downloads. Start with one or two, not twenty.

In Tag Manager, an event is a GA4 Event tag plus a trigger that says when to send it. Google’s worked example is a newsletter signup: create the GA4 Event tag, name the event signup_newsletter — lower-case words joined by underscores — then build a trigger that fires when the signup button is clicked. For a thank-you page, a page-view trigger does the same job.

Newsletter signup click — which pages bring new subscribers; GA4 Event tag, click trigger on the signup button. Contact form sent — how many enquiries the site produces; GA4 Event tag, Form Submission trigger set to fire only on a successful send. Phone number tap — how many visitors try to call from the site; GA4 Event tag, click trigger on the telephone link. Scrolling to the end, brochure or price-list download, and outbound link click are already recorded by enhanced measurement — check Analytics before building a tag for them.

Notice how many rows say “already recorded”. Enhanced measurement, which comes with the Google tag, records scrolling, outbound clicks and file downloads on its own, and the automatically collected events cover first visits, session starts and user engagement. Before building a tag for any of those, open Analytics and look — the data may already be there.

Event names deserve a minute of thought. Analytics has recommended names for the standard actions — purchase, login, sign_up — and using those unlocks ready-made reporting. For anything else, invent a short name in lower-case words joined by underscores, and write the list down where the whole business can see it.

Form submissions have one trap that catches nearly everyone once: a trigger that fires when the form is attempted counts visitors who hit “send” and were stopped by a missing field. The form submission trigger has an option called Check Validation, which makes it fire only when the form is actually sent. A “Wait for Tags” option holds the submission briefly until the tags that depend on it have fired, or a timeout passes.

Built-in variables: facts Tag Manager already knows

Variables are the quiet third of Tag Manager, and the built-in ones are free facts. They live under the Variables tab, in a section called Built-In Variables, where a Configure button switches each one on for use in any tag or trigger.

The useful ones for a small business are short to list: the page address and the page path, so a trigger can be limited to one page; the click address, click text, click class and click ID, so a trigger can pick out one button among many; and the form details — form ID, form address and form text — so a trigger can tell one form from another. When a form submission trigger fires, Tag Manager also fills in the form element itself, the form’s classes and its target. Switch on only the variables you actually use: every one that is on appears in the lists everywhere else in the tool.

Preview and debug: try it before your visitors do

Preview mode is the single most important habit in Tag Manager, and it costs nothing. It lets you browse the site exactly as if the current draft were already live, so a new tag can be checked before anyone else meets it — Tag Assistant shows which tags fired, in which order, and what data each one carried.

To start it, open the Workspace tab and click Preview at the top right. Tag Assistant opens; enter the site’s address and click Connect. The site opens showing Connected at the bottom right; click back on the Tag Assistant tab and Continue to reach the debug view. Then use the site as a visitor would — click the button, send the form, scroll the page — and the debug view updates as you go, showing whether the tag fired and what stopped it.

Three things about preview mode save embarrassment later. First, it is invisible to ordinary visitors: the debug view appears only in the browser that started the preview, or for people it has been shared with. Second, an older version can be previewed too, from Versions > More Actions > Preview. Third, a preview can be shared with a colleague: in Tag Assistant choose More Actions, then Share, enter the site’s domain and the tags to debug, and send the preview link. To stop, click the X at the top left of the debug view, then Stop debugging. One limit: the debug view is not available for mobile app containers, though AMP containers can still be previewed.

Two colleagues at a desk in a bright office, one pointing at a large monitor showing soft, blurred charts, both smiling.

Publishing a version, and stepping back when you need to

Nothing reaches the live site until it is published. Edits sit in the workspace as a draft, and the draft can be tested in preview for as long as it takes to get right. When it is ready, click Submit at the top right of the Workspace tab, and choose Publish and Create Version to put the changes live, or Create Version to save them without publishing. Enter a name and a description, look over the Activity History, and click Publish.

Versions are the safety net that makes the whole tool forgiving. Every publish is kept as a numbered version with its name and description, so if a new tag misbehaves after going live, the fix is not a late-night code change: open the previous version and publish it again. That is also why version names matter: “Added GA4 and the quote-form event, 4 Dec” will make sense in six months, while “Version 12” will not.

Mistakes that quietly break the numbers

MistakeWhat goes wrongThe fix
Two Analytics tags on one pageThe hard-coded snippet and the Tag Manager tag both report the same visits.Remove the hard-coded code; keep one Google tag in Tag Manager.
Publishing without previewA broken tag goes live and pollutes the reports.Preview every change and click the button yourself before publishing.
A trigger with no conditionAn “all clicks” trigger turns every tap into an event, and the reports fill with noise.Narrow the trigger to the button, link or page you actually mean.
No naming habitSix months later nobody can tell what any tag does.Name tags by tool and action, triggers by what sets them off.
Counting form attempts, not sendsVisitors stopped by a missing field are counted as enquiries.Use Check Validation on the form submission trigger.
A new page without the snippetThat page sends nothing, and the gap looks like nobody visited it.Check every new page or template carries the container code.
Test tags left in the live containerStray tags send stray data after the test is forgotten.Delete or pause anything that was only ever for testing.

Most tracking problems are not technical failures. They are ordinary oversights, and they all share one feature: the reports keep coming in, looking normal, while quietly being wrong.

Two Analytics tags on one page — the hard-coded snippet and the Tag Manager tag both report the same visits; fix: remove the hard-coded code; keep one Google tag in Tag Manager. Publishing without preview — a broken tag goes live and pollutes the reports; fix: preview every change and click the button yourself before publishing. A trigger with no condition — an “all clicks” trigger turns every tap into an event, and the reports fill with noise; fix: narrow the trigger to the button, link or page you actually mean. No naming habit — six months later nobody can tell what any tag does; fix: name tags by tool and action, triggers by what sets them off. Counting form attempts, not sends — visitors stopped by a missing field are counted as enquiries; fix: use Check Validation on the form submission trigger. A new page without the snippet — that page sends nothing, and the gap looks like nobody visited it; fix: check every new page or template carries the container code. Test tags left in the live container — stray tags send stray data after the test is forgotten; fix: delete or pause anything that was only ever for testing.

How to start today

No developer on retainer, no new software, no budget — just an afternoon with the container, and a short habit afterwards that takes minutes a week.

  • Create the account at tagmanager.google.com, then one Web container named after your site’s top-level address.
  • Put the single snippet near the top of the head of every page, and use the Test box to confirm it is in place.
  • Add the Google tag with your Analytics Tag ID, on the Initialization trigger, and remove any hard-coded Analytics code.
  • Open Preview, visit the site, and check the Google tag fires on every page you look at.
  • Add one event only — the action that matters most, such as the contact form being sent — and test it in Preview before anything else.
  • Publish the version with a name that says what changed, then check the live site once with Tag Assistant.
  • Write down your naming pattern for tags, triggers and variables, and keep it where anyone who touches the container can see it.
  • Set a monthly reminder to open the container, remove test tags, and check the numbers against what the business received.

Then leave it alone for a week and let the data gather. Open Analytics, look at the Realtime view while you click around the site yourself, and confirm the events you built are arriving. After that, add the next event — one at a time, each tested before it is published.

— HoldTo1 Editorial

Keep reading

RSS & publishing

Best AI Image Generators

Eleven image makers that turn a sentence into a finished picture — from the free chatbot that edits by conversation to the German API that charges three cents a picture.

Read article
RSS & publishing

Best AI Tools for Teachers

Eleven classroom helpers that plan lessons, level reading, mark work and draft parent notes — from the free toolkit that covers a whole week to the language specialist that levels every text.

Read article
RSS & publishing

Best AI Writing Tools

Eleven writing helpers that draft, tighten, rephrase and optimise copy — from the free chatbot that does almost everything to the fiction specialist that keeps a novel straight.

Read article