Google Tag Manager (GTM) is a free tool for managing tracking codes (tags) on a website without editing the site code each time. You install one container, then add and change tags for GA4, Google Ads, Meta, LinkedIn and others in GTM's interface.
The building blocks
| Element | What it is |
|---|---|
| Tag | Code that sends data, for example a GA4 event |
| Trigger | When the tag fires, for example a click or a purchase |
| Variable | Values used by tags and triggers, such as page URL or order value |
| Data layer | A structured object the site uses to pass data to GTM |
Getting started
- Create an account and container.
- Add the GTM code to every page.
- Add the Google tag and GA4 events.
- Set up Consent Mode with your consent platform.
- Test in Preview and publish with a clear version name.
Best practice
Use the data layer rather than scraping the page, name everything consistently, use folders, limit who can publish and consider server-side tagging.
Frequently asked questions
Is Google Tag Manager free?
Yes.
What is the difference between GTM and Google Analytics?
GTM manages tags and sends data. Google Analytics stores and reports it.
Read also
Sources
- Google Tag Manager Help: support.google.com/tagmanager/answer/6102821
