Google Tag Manager is a free tool that lets you add and manage tracking codes on your website without editing the site’s source code directly. Instead of asking a developer to add each tracking pixel, analytics script or conversion tag to the HTML, you place one GTM container snippet on the site and then manage everything else through GTM’s web interface.
At Gorilla Marketing, GTM is a core part of our analytics and tracking setup for both SEO and PPC clients. It centralises tracking management, reduces developer dependency and makes it significantly easier to deploy the measurement infrastructure that both channels need. This guide covers setup, core concepts and the specific ways SEO and PPC teams use GTM in practice.
Why GTM Exists

Before tag managers, adding any tracking to a website required a developer to edit the HTML. Every new analytics tool, every marketing pixel, every conversion tracking tag needed code changes. This created bottlenecks: marketing teams waited on development queues, tags were added inconsistently, and nobody had a clear picture of what was running on the site.
GTM solves this by separating tag management from site code. The site loads one container script. Inside that container, marketing and analytics teams add, edit and remove tags through a visual interface. No code deployments needed for each change.
The result: faster implementation, fewer dependencies and a single place to audit what tracking runs on the site.
Core Concepts: Tags, Triggers and Variables
Everything in GTM revolves around three components.
Tags are snippets of code that execute on your site. A GA4 configuration tag loads Google Analytics. A Google Ads conversion tag fires when someone completes a purchase. A Meta pixel tracks visitor behaviour for Facebook advertising. Each tracking tool you use gets its own tag or set of tags.
Triggers define when tags fire. A trigger might say “fire this tag when someone loads any page” (a page view trigger) or “fire this tag when someone clicks a button with the ID ‘submit-form'” (a click trigger) or “fire this tag when a custom event called ‘purchase_complete’ is pushed to the data layer” (a custom event trigger).
Variables provide data that tags and triggers use. Built-in variables include things like Page URL, Click ID and Referrer. Custom variables can pull data from cookies, the data layer or page elements. Variables answer questions like “which page is this?” or “what did the user click on?”
A practical example: you want to track form submissions in GA4. The tag is a GA4 Event tag configured with the event name “form_submit”. The trigger fires when the form’s submit button is clicked. A variable captures the form name so the event includes which specific form was submitted.
Setting Up GTM
Create an account and container
Go to tagmanager.google.com and sign in with a Google account. Create a new account (usually one per business) and a container (usually one per website). Select “Web” as the target platform.
GTM provides two code snippets. The first goes in the `
` section of every page. The second goes immediately after the opening `` tag. Most CMS platforms and website builders have a dedicated field for adding these snippets without editing template files directly.Verify the installation
After adding the snippets, check that GTM is loading. The simplest method: install the Tag Assistant Chrome extension, visit the site and confirm that the GTM container is detected. Alternatively, open the browser’s developer tools, check the Network tab and look for requests to googletagmanager.com.
Setting Up GA4 Through GTM
The most common first tag in any GTM container is the GA4 configuration tag.
Create a new tag, select “Google Analytics: GA4 Configuration” as the tag type and enter the Measurement ID (found in GA4 under Admin, then Data Streams, then the relevant stream). Set the trigger to “All Pages” so GA4 loads on every page of the site.
If GA4 was previously installed directly on the site (via a script in the HTML), remove the hard-coded version to avoid duplicate data collection. Only one method should be active.
How SEO Teams Use GTM
GTM is not an SEO tool in the traditional sense. It does not affect rankings directly. But it provides measurement capabilities that make SEO work more effective.
Tracking on-site engagement for SEO content
SEO teams need to understand how organic visitors interact with content. GTM enables tracking of specific engagement actions that GA4’s default setup misses.
Scroll depth tracking beyond the default 90% threshold. GTM’s built-in scroll trigger can fire at custom percentages: 25%, 50%, 75% and 100%. This shows whether organic visitors read the full page or abandon halfway through.
Internal link click tracking. A click trigger filtered to internal links reveals which navigation paths organic visitors take. Combined with GA4 data, this shows whether SEO content effectively guides visitors toward commercial pages.
Video engagement. If the site includes embedded videos, GTM can track play, pause, progress milestones and completion. For SEO content that includes video, this data reveals whether the video adds engagement value.
Deploying structured data tags
GTM can inject JSON-LD structured data onto pages. For sites where adding schema markup through the CMS is difficult, GTM provides an alternative deployment method. FAQ schema, product schema or organisation schema can be managed through GTM without touching the site code.
A note of caution: Google recommends including structured data in the page HTML rather than injecting it via JavaScript where possible. GTM-deployed schema does work, but hard-coded schema is more reliably detected.
Monitoring Core Web Vitals
GTM can fire tags based on Core Web Vitals performance data using the web-vitals JavaScript library. This sends real user performance metrics directly to GA4, providing a continuous stream of speed and usability data alongside traffic and engagement metrics.
How PPC Teams Use GTM
PPC is where GTM becomes almost indispensable. Running paid campaigns without proper conversion tracking wastes budget, and GTM makes conversion tracking significantly easier to implement and maintain.
Google Ads conversion tracking
The standard PPC setup: a Google Ads conversion tag fires when a user completes a valuable action. In GTM, create a Google Ads Conversion Tracking tag with the Conversion ID and Conversion Label from the Ads account. Attach a trigger that fires on the conversion event, whether that is a thank-you page load, a form submission or a custom data layer event.
For detailed setup including testing and debugging, see the GA4 conversion tracking guide.
Remarketing tags
GTM deploys remarketing pixels for Google Ads, Meta (Facebook), LinkedIn, Microsoft Ads and other platforms. Each pixel gets its own tag, typically triggered on all pages. GTM keeps these organised in one container rather than scattered through the site code.
Enhanced conversions
Google Ads Enhanced Conversions improve measurement accuracy by sending hashed first-party data (email addresses or phone numbers from form submissions) alongside conversion tags. GTM has a built-in Enhanced Conversions tag type that handles the hashing and transmission automatically.
Multi-platform tracking
Most PPC campaigns run across several platforms simultaneously. GTM manages tags for all of them in one place: Google Ads, Meta, LinkedIn, Microsoft Ads, TikTok and others. When a conversion event fires, multiple platform tags can trigger from the same event, ensuring consistent conversion counting across all advertising accounts.
Preview Mode and Testing
Never publish GTM changes without testing them first. GTM’s Preview mode lets you browse the site while seeing exactly which tags fire, which triggers activate and what data is passed.
Click the Preview button in GTM’s top right corner. A new tab opens with the site loaded and a debug panel showing tag activity. Navigate through the site, complete the actions you want to track and verify that the correct tags fire with the right data.
Use Preview mode alongside GA4’s DebugView (Admin, then DebugView) to confirm that events arrive in GA4 with the expected parameters.
Common issues to check for:
Tags firing on pages where they should not (trigger conditions too broad)
Tags not firing when expected (trigger conditions too specific or incorrect)
Duplicate tags sending the same data twice
Missing variables producing undefined or empty values
Publishing and Version Control
Once testing confirms everything works correctly, click Submit to publish the container. GTM creates a version snapshot with each publish, meaning any change can be rolled back to a previous version if something goes wrong.
Add a descriptive version name and notes with each publish. “Added Google Ads conversion tag for contact form” is infinitely more useful than “Version 14” when reviewing changes six months later.
Consent Mode v2
For UK businesses running Google Ads, Consent Mode v2 is strongly recommended and required for certain advertising features. GTM is the most common deployment method.
Consent Mode communicates a visitor’s cookie consent status to Google tags. When a visitor declines cookies, tags still fire but in a restricted mode that does not set cookies or collect personal data. Google uses modelled conversions to fill gaps in the data.
Implementation in GTM involves a consent initialisation tag that loads before all other tags and reads the consent status from the site’s cookie banner. Tags are then configured to respect consent categories (analytics_storage, ad_storage, ad_user_data, ad_personalization). GTM’s built-in consent templates handle most of this, but the configuration needs to match the specific cookie consent platform the site uses.
Without Consent Mode, Google Ads remarketing and conversion tracking may not function properly for visitors who have not consented, and the account risks non-compliance with UK data protection requirements.
The Data Layer
The data layer is a JavaScript object that passes structured information from the website to GTM. Rather than having GTM scrape information from the page (fragile, breaks when the page changes), the data layer provides it in a clean, structured format.
For e-commerce sites, the data layer is essential. Product names, prices, categories, transaction values and order IDs should all be pushed to the data layer so that GA4 e-commerce tracking, Google Ads conversion values and remarketing tags receive accurate information.
For simpler sites, the data layer handles form submission details, user login status, page categories and any custom information that tags need but cannot reliably extract from the page itself.
The data layer is configured by a developer as part of the initial GTM setup. Once in place, it makes all subsequent tag configurations more reliable and less dependent on page structure.
Common GTM Mistakes
Tags firing on every page when they should be restricted. A conversion tag that fires on all pages instead of only the thank-you page inflates conversion counts. Always verify trigger conditions are specific enough.
Duplicate tracking. GTM running GA4 while the site also has a hard-coded GA4 script. Every metric is doubled. Remove hard-coded scripts when migrating to GTM.
Never using Preview mode. Publishing without testing is the most common cause of tracking errors. Preview mode exists for a reason.
Container bloat. Tags for tools no longer in use, triggers referencing deleted page elements, variables pulling empty data. Quarterly audits prevent containers from becoming unmanageable.
Incorrect consent configuration. Tags that fire before consent is granted, or tags that stop firing entirely after consent implementation, both cause problems. Test consent scenarios thoroughly.
Best Practices
Use a consistent naming convention. A format like “GA4 – Event – Form Submit” for tags, “Click – Submit Button” for triggers and “CJS – Form Name” for custom JavaScript variables keeps the container readable as it grows.
Document everything. Maintain a tracking plan listing every tag, its purpose, its trigger and its parameters. GTM containers grow quickly, and undocumented tags become a maintenance problem.
Use folders. GTM supports folders for organising tags, triggers and variables. Group by purpose (analytics, advertising, remarketing) or by platform (GA4, Google Ads, Meta).
Audit regularly. Tags accumulate. Platforms change. A quarterly review of the GTM container catches tags for tools no longer in use, triggers that reference page elements that no longer exist and variables pulling data that is no longer relevant.
Control access. GTM supports user permissions. Give publish access only to people who understand the implications. Read and edit access work well for team members who need to review or propose changes without the ability to push them live.
Gorilla Marketing’s analytics and tracking service includes GTM setup, tag configuration, ongoing maintenance and the conversion tracking infrastructure that both SEO and PPC reporting depend on. Get in touch if your current tracking setup needs organising.




