Websites often need multiple tracking codes: analytics, advertising conversion tags, heatmaps and remarketing pixels. Adding each one directly to your site can become messy and requires developer help every time. Google Tag Manager (GTM) solves this by letting you manage all tags from one interface, often without editing website code.
Core Concepts
| — | — | — |
|---|---|---|
| Container | Holds all tags for a website | GTM-XXXXXX |
| Tag | Code that sends data to a tool | Google Analytics 4 configuration tag |
| Trigger | Condition for firing a tag | All pages, button click, form submission |
| Variable | Dynamic value used in tags and triggers | Page URL, click text |
| Data layer | Structured data shared with GTM | Purchase value, product name |
Step 1: Create an Account and Container
Sign in to Tag Manager, create an account for your business and a container for your website.
Step 2: Install the Container
GTM provides two code snippets: one for the head and one immediately after the opening body tag. Many WordPress plugins can insert them for you. Install GTM only once.
Step 3: Add a GA4 Tag
- Create a new tag using the Google tag type
- Enter your GA4 measurement ID
- Set the trigger to fire on all pages (Initialisation or All Pages)
- Save
Step 4: Track Events
Examples:
- Outbound link clicks: trigger on clicks to external URLs
- Button clicks: trigger on clicks with specific text or classes
- Form submissions: trigger when forms submit successfully
- Scroll depth: trigger at 50% or 90% scroll
Send these as GA4 event tags and mark important events as key events in GA4.
Step 5: Preview and Debug
Use Preview mode to open your site with the Tag Assistant, which shows which tags fired on each action. Fix issues before publishing.
Step 6: Publish
Submit changes with a descriptive version name, such as “Added newsletter form tracking”. Versions allow rollback if something goes wrong.
Best Practices
| — | — |
|---|
Consent and Privacy
Configure consent mode and ensure tags respect users’ cookie choices where required. Avoid sending personal information to analytics tools.
Common Mistakes
- Installing GA4 both directly and through GTM (double counting)
- Publishing without testing
- Vague tag names
- Adding too many third-party tags that slow the site
Frequently Asked Questions
Is Google Tag Manager free?
Yes, the standard version is free.
Do I need GTM for GA4?
No, but GTM makes it easier to add events and other tags.
Can GTM slow my site?
Many heavy tags can; GTM itself is lightweight.
Is coding required?
Basic setups require little code; advanced tracking may need developer help.
Conclusion
Google Tag Manager centralises tracking and reduces dependency on developers. Install the container once, use tags, triggers and variables wisely, test with Preview mode and keep your setup organised and privacy-compliant.
