Academy · Google Tag Manager · Lesson
Google Tag Manager from zero: one container, no code in your site
What GTM is and why every site needs one container. Tags, triggers, variables, the data layer explained on a form, Preview, versions, naming conventions and what never goes into GTM.
The situation
You want to add the Meta pixel. A month later, the Google Ads tag. Then a chat script, then an event for the WhatsApp button. Every time you write to the developer, wait three days, check, and something does not work on mobile. Or worse, you have six scripts pasted straight into the template and nobody remembers which does what.
Google Tag Manager solves exactly that. One snippet of code in the site (the container), placed once. After that, everything to do with measurement is done from the GTM interface, with versions, preview and the ability to roll back.
The three pieces
- Tags — what runs. The Google tag (GA4), the Google Ads conversion tag, the Meta pixel, a custom script.
- Triggers — when it runs. On page load, on a click on an element, on a form submission, on a data layer event.
- Variables — what information the tags use. The page URL, the text of the clicked button, the order value, the GA4 measurement ID.
Every GTM configuration is a sentence: when [trigger], run [tag] with [variables]. Once you understand that, you understand GTM.
The data layer, on a form example
The data layer is a JavaScript object (dataLayer) on the page where the site puts information for GTM. It is the bridge between what your site knows (that a form was successfully submitted, which service was requested) and what GTM can measure.
Why this beats a "click on the Submit button" trigger: the click also happens when the form has validation errors. The data layer push happens only when the request actually went through. It is the difference between measuring intent and measuring the result.
Preview, versions, publishing
- Preview (Tag Assistant): opens the site in a debug session where you see, on every action, which tags fired, which did not and why. Nothing goes live until you publish. You test the real form and check that
generate_leadappears exactly once. - Versions: every publish creates a numbered version with a description. If something breaks, you go back to the previous version in two clicks.
- Workspaces: if several people change the container, each works separately and merges at the end.
The rule: never publish without Preview, and write in the version description what you changed and why. Six months from now, you will be the one reading it.
Naming conventions
A container without conventions becomes, within a year, a pit of 80 tags called "Tag 3" and "test". Adopt a format and stick to it:
- Tags: platform – type – what it does.
GA4 – Event – generate_lead,GAds – Conversion – Lead form,Meta – Pixel – Base. - Triggers: type – when.
CE – form_submit_ok,Click – WhatsApp button,Page – Thank you. - Variables: source – name.
DL – form_name,Const – GA4 Measurement ID.
Use folders per platform and a single Google tag for configuration that all GA4 events refer to. The measurement ID lives in a constant variable, not copied into 12 tags.
What never goes into GTM
Who has access to the container
You, as the account owner. The person doing the measurement, with publish rights. The agency, with edit rights — you or your person publish, after Preview. When you change agencies, you remove their access in a minute and lose nothing.
What to remember
- One GTM container in the site, once; the rest of measurement is done from the interface.
- Every configuration is "when [trigger], run [tag] with [variables]".
- The data layer measures the result (form successfully sent), not the intent (button click).
- Never publish without Preview; every version with a description.
- No personal data, no site functionality, no unread scripts in GTM.
Check yourself
Frequently asked
I already have the GA4 tag pasted directly in the site. Should I move it to GTM?
Yes, but in one move: add the tag in GTM, verify in Preview, publish and remove the old code from the site the same day. If both remain, you double every event.
Does GTM slow the site down?
The container itself is small. What slows things down is what you put in it: ten pixels and three chat scripts weigh the same whether they sit in GTM or in the template. GTM makes them visible and easy to remove.
Who should own the container?
You, with the company Google account. Agencies and freelancers get user access you can revoke. A container owned by a departed agency is a lost container.
Want Valhalla to check this for your business?
Valhalla Pulse scans the public signals of your website for free, in seconds.
Sources
Next lesson · in the "Performance Marketing" path
Key events and attribution in GA4: why your numbers never match Google AdsHow to mark key events, which parameters matter, data-driven vs last click, conversion windows and the five reasons GA4 and Google Ads show different numbers without either being wrong.Lesson · 6 min · Intermediate · Updated 28 Sept 2026✓Related lessons