hello@newnorth.nl+31 (0) 85 401 31 62
/Journal

Google Tag Manager for beginners

GuideTag management2022.10.30
Freek Kampen
Freek KampenCo-founder, New North Digital

Install tracking without touching your site's code. Containers, tags, triggers and variables explained, plus how to check it actually works.

The problem GTM solves

You want to measure what happens on your site: where visitors come from, what they do, whether your campaigns pay off. That requires JavaScript tracking scripts on your site, also known as marketing tags.

Without a tag manager that means: open the code editor, paste the script, adjust it, deploy. Fine for one tag. At ten tags you have a mess nobody can read, and every change needs a developer.

With GTM you paste one snippet into your site once. After that you manage everything through the interface.

What it gets you

  • You don't need access to your site's code to add a new tag.
  • Tags load asynchronously, which keeps your site faster than loose scripts in your HTML.
  • You configure tags through a clear interface instead of in code.
  • You can test and preview without polluting your existing reports.
  • It has version control, so you can see what changed and roll back.
  • Managing several sites, you can port a configuration easily.

The container

Setting up your account, you install the container tag on your site. From then on it is the only tag in your HTML.

The container holds everything else you want to run: your tags, triggers and variables. Everything you add later goes in there, not into your site.

Tags

Tracking tags come in all shapes: the Google Ads tag, the Meta pixel, the LinkedIn Insight tag, Hotjar, and so on. In GTM you bundle them all under that one container.

What a tag does is simple: forward data captured on your site to a processing endpoint, such as Analytics or your ad manager. Google ships templates for the most common ones. If none fit, you can use a custom HTML tag.

Have a look at the Community Template Gallery too, with containers and tags built by others. It gives a good sense of what's possible, and sometimes your solution is already sitting there.

Triggers

A trigger decides when a tag fires. GTM has a set of predefined triggers to choose from.

A configuration tag, like the one for Analytics, usually hangs off a pageview on all pages. A tag measuring a signup hangs off a click on a specific button, or a form submission. The craft is in making the trigger exactly specific enough: too broad and you measure noise, too narrow and you miss cases.

Variables

Variables decide which data you send along. Any element on your page can become one: the name, the URL, the value of an order, any other attribute.

Those variables get picked up by your reporting tool, where they supply the context a bare event lacks. 'Purchase' is an event. 'Purchase of 240 euro, three items, via the newsletter' is an event with variables.

Checking it works

Everything configured, but does it work? That's what GTM's preview and debug mode is for. In it you browse your site as an ordinary visitor while a second window shows exactly which tags fire, on which trigger, and with which values.

Once it checks out, publish your container. This is the step most often forgotten early on: until you publish, nothing changes for your visitors. Give the version a name and a short description, because in three months you will have forgotten what you did.

Over to you

That's the theory. A tool like this you only learn by using it.

Create an account today, put it on a test site, and break things in it. Preview mode means you can't damage anything your visitors will notice.

Want to talk about this?

Let's talk data.

Tell us about your stack, your goals, the data you wish you had.

Takes 1 minute