Skip to content
AE DIGITAL
Analytics & TrackingBy 6 min read

Google Tag Manager for small businesses: a beginner's guide to tags, triggers and variables

A beginner's guide to Google Tag Manager: tags, triggers and variables, container installation, the data layer, preview mode, naming conventions, versions and permissions.

Article cover: the word “GTM” next to a glowing icon on a violet space background

What Google Tag Manager is and what it isn't

Google Tag Manager (GTM) is a system that loads measurement and marketing code snippets, called tags, on your website according to rules you set in a web interface. Instead of asking a developer to paste every new pixel into the theme, you install the container once and manage GA4, Google Ads, Meta and other tools from there.

GTM is not an analytics tool, though: it produces no reports and stores no data. It also doesn't decide by itself whether a user has consented to cookies. There are several container types (web, iOS, Android, AMP and server); this guide covers the client-side web container. Server-side is a later step, described in our guide to implementing server-side tagging.

Tags, triggers and variables: the three building blocks

Every GTM setup comes down to three objects listed in the left-hand menu of your workspace.

Tags: what to send

A tag is the instruction to run: send an event to GA4, record a Google Ads conversion, load a third-party script. GTM offers ready-made templates for common tools; use them rather than Custom HTML tags whenever you can. According to web.dev, templates are safer and lighter than code pasted into a Custom HTML tag.

Triggers: when to send it

A trigger sets the condition: a page view, a link click, a form submission, scroll depth or a custom data layer event. It can be broad (all pages) or filtered, for example "Page Path contains /thank-you". The more precise it is, the fewer tags fire where they aren't needed.

Variables: which data

Variables supply values to tags and triggers: page URL, clicked link text, order value. Built-in variables are enabled under Variables, Configure; user-defined ones read, for example, a data layer field, a cookie or a page element. A complete example: tag "GA4 - Event - generate_lead", trigger "Custom Event = form_submitted", variable "DLV - request_type" passed as a parameter.

Installing the container correctly

Once you've created the account and container, GTM shows two code blocks. According to Google's installation guide, the first goes as high in the <head> as possible and the second (the noscript part) immediately after the opening <body> tag, on every page of the site. Shopify, WordPress and similar platforms have dedicated fields or plugins, but the principle is the same.

Common installation mistakes

  • Two different containers on the same page, or the same container loaded twice: events get duplicated.
  • GA4 installed both in the theme and through GTM, which also doubles page views.
  • The snippet present only on some templates, for example missing on checkout or thank-you pages.
  • Essential site features, such as the cookie banner or cart functions, loaded through GTM. web.dev advises against it because they arrive late and break when the script is blocked.

The data layer and why you need it

Scraping data from the page with CSS selectors works until someone changes the theme. The data layer is a JavaScript object where the site explicitly writes the information tracking needs, and GTM reads it from there.

Google's documentation says to declare it before the container snippet with window.dataLayer = window.dataLayer || []; and to add data with dataLayer.push({'event': 'form_submitted', 'request_type': 'quote'});. The event key is what fires custom event triggers. The dataLayer name is case-sensitive, so datalayer.push will fail. Values only last for the current page, so they must be pushed again on every page load.

The healthiest split of responsibilities is this: the developer guarantees the data layer holds correct data, and the marketer decides in GTM what to do with it.

Preview and debugging before you publish

No change should go live without going through Preview. In the workspace, click Preview to open Tag Assistant, enter your site's URL and click Connect. The site opens in a new window showing "Connected" in the bottom right. Back in Tag Assistant you can see, for every event on the page, which tags fired, which trigger fired them, or why they didn't fire.

A minimum test checklist

  1. The tag fires once per event, not twice.
  2. Parameters contain real values, not "undefined" or empty text.
  3. The tag doesn't fire on pages where it shouldn't.
  4. When you reject cookies in the banner, non-essential tags don't fire.
  5. In GA4, DebugView receives the event with the expected parameters.

On that last point: in Italy, for example, the data protection authority's guidelines of 10 June 2021 require prior consent for non-technical cookies. For the GTM configuration, see our guide to Google Consent Mode v2. This is not legal advice.

Naming conventions and folders

A container with fifty items called "Tag 1", "Click" and "Copy of GA4" becomes unmanageable within months. Pick a convention and apply it everywhere.

  • Tags: Tool - Type - Detail, for example "GA4 - Event - purchase" or "Ads - Conversion - Form lead".
  • Triggers: Type - Condition, for example "Click - tel: link" or "CE - form_submitted".
  • Variables: a prefix per type, such as "DLV - order_value", "CJS - page_id", "Const - GA4 measurement ID".

Folders (the Folders menu) group items by tool or project. Delete or pause tags you no longer use: web.dev points out that blocking them with exceptions still leaves their code in the container, which has a 300 KB size limit.

Versions, workspaces and permissions

Every publish creates a version, a snapshot of the container you can roll back to if something breaks. When you click Submit, write a clear name and description ("Added generate_lead event on contact form"); six months from now it will be the only documentation you have.

Workspaces

A workspace is a separate area where you prepare changes without touching your colleagues' work. Standard accounts get up to three concurrent workspaces, the default plus two custom ones. If two people edit the same item, GTM flags the conflict and asks which version to keep.

Permissions

At container level Google offers four levels: Read, Edit, Approve and Publish. A simple rule for a small business: the account belongs to the company, not the agency; people working on tags get Edit; one or two people hold Publish. Account administrators are managed under Admin, User Management.

With these basics in place, the next step is connecting the container to a complete measurement strategy, covered in our GA4 server-side tracking guide. If you'd rather have your current container reviewed before adding anything, contact us.

Frequently asked questions

Does Google Tag Manager replace Google Analytics?

No. GTM measures nothing on its own: it loads and configures other tools, such as the Google tag for GA4, Google Ads or advertising pixels. Reports stay in those destination tools.

Do I need a developer to use Google Tag Manager?

Usually yes for installing the container and, above all, for pushing reliable data to the data layer, such as order value or lead type. After that, tags, triggers and variables are managed in the interface without touching site code.

How many workspaces does a free container have?

According to Google's documentation, standard accounts get up to three concurrent workspaces: the default one plus two custom ones. Tag Manager 360 accounts have no such cap.

Does GTM handle cookie consent?

Not on its own. You need a consent management platform and a tag setup that respects the user's choice: under EU rules such as the Italian data protection authority's cookie guidelines, non-essential tags should only fire after consent.

Sources

  1. 2. Install a web container — Tag Manager Help
  2. The data layer — Google for Developers
  3. Preview and debug containers — Tag Manager Help
  4. Workspaces — Tag Manager Help
  5. Managing users and permissions — Tag Manager Help
  6. Best practices for tags and tag managers — web.dev
  7. Linee guida cookie e altri strumenti di tracciamento - 10 giugno 2021 — Garante per la protezione dei dati personali

Related articles

Tell us what isn't working.

We reply within one business day with a first opinion and, if it makes sense, a quote.

Write to us