Google Tag Manager

Google Tag Manager

Google Tag Manager is a tag management system that lets marketers deploy and update analytics and marketing scripts without code changes. The GTM container script loads synchronously in the page head and injects configured tags, triggers, and variables on behalf of other vendors. No data collection of its own — acts as a loader for other scripts.

Overview

Google Tag Manager (GTM) is a tag management system that allows marketing and analytics teams to deploy, configure, and update tracking scripts on a website without modifying site code. It is the most widely used tag manager on the web.

What This Script Does

The GTM container script (gtm.js) loads synchronously from googletagmanager.com and acts as a loader for other scripts configured in the GTM container. Key technical details:

What GTM itself does:

  • Downloads the container configuration (a JSON payload defining which tags, triggers, and variables are active).
  • Evaluates trigger conditions (page URL, click events, custom events, DOM conditions).
  • Injects configured tags (script elements) into the page when their triggers fire.
  • Manages a data layer (window.dataLayer) that acts as a message bus between the site and configured tags.

What GTM itself does NOT do:

  • GTM does not set any cookies of its own.
  • GTM does not collect or transmit analytics or personal data.
  • GTM does not perform tracking, profiling, or advertising functions.
  • GTM is functionally a script loader — comparable to a <script> tag but with a management UI.

What GTM loads (indirect effects):

  • The tags configured within a GTM container may include Google Analytics, Google Ads, Facebook Pixel, Hotjar, or any other third-party script. These loaded tags have their own cookies, data collection, and privacy implications.
  • GTM's consent-aware features allow tags to be configured with consent checks, so tags only fire when the corresponding consent category has been granted.

Consent Mode integration: GTM natively supports Google Consent Mode v2. When integrated with a consent management platform, GTM reads consent state from the data layer and passes ad_storage, analytics_storage, ad_user_data, and ad_personalization signals to Google tags. Non-Google tags can use GTM's consent-checking triggers.

Server-side GTM: A server-side GTM container runs on your own infrastructure (Cloud Run, App Engine, etc.) and proxies tag requests through a first-party endpoint. This reduces client-side JavaScript, improves page performance, and gives you more control over data flowing to third parties.

Consent & Compliance

Google Tag Manager is classified as essential because it is a tag management tool with no inherent data collection. Its consent categorization depends on what it loads:

Under GDPR and ePrivacy, GTM itself does not require consent because it does not set cookies or process personal data. However, the tags loaded by GTM absolutely require consent based on their individual purposes. Loading GTM without consent is acceptable only if GTM is configured to respect consent signals and block non-essential tags until consent is obtained.

Under CCPA, the same principle applies: GTM is a neutral loader, but the tags it deploys may involve "selling" or "sharing" personal information.

Critical implementation requirement: If you load GTM without consent, you must ensure that the GTM container is configured with consent-aware tag firing. Tags classified as analytics or marketing must have consent-based triggers. Loading GTM pre-consent is only defensible if GTM does not fire any non-essential tags before consent is granted.

Should You Block This Without Consent?

No. GTM itself has no tracking functionality and is classified as essential infrastructure. It can be loaded before consent, provided that the GTM container uses consent-aware triggers (Google Consent Mode or custom consent-checking triggers), no analytics or marketing tags fire before the user grants consent, and only essential tags (e.g., consent banner script, reCAPTCHA) are configured to fire without consent requirements.

If GTM is not configured with consent-aware triggers and fires all tags immediately on page load, blocking GTM before consent effectively blocks all the non-essential tags it would load. In this scenario, blocking GTM is a valid (if blunt) approach.

Visit website

Consent Categories

Essential

Also Known As

GTMgtm.jsGoogle Tag Manager GDPRtag management consentcontainer script

Industries

Computers Electronics and TechnologySearch Engines

Tracked Domains (2)

googletagmanager.comAnalytics
googletagservices.comAnalytics

Frequently Asked Questions

Does Google Tag Manager itself require cookie consent?

No. GTM sets no cookies and collects no data on its own. It can load before consent, but only if the container is configured so analytics and marketing tags do not fire until the user grants consent. GTM is a neutral loader — the tags it injects have their own individual consent requirements.

What does the GTM container script do?

gtm.js loads from googletagmanager.com, downloads the container configuration, evaluates trigger conditions, and injects configured tags when triggers fire. It manages window.dataLayer as a message bus between the site and tags. GTM natively supports Google Consent Mode v2 for passing ad_storage and analytics_storage signals to Google tags.

How does ConsentStack integrate with Google Tag Manager?

ConsentStack classifies GTM as essential and does not block the container script. It passes consent signals through window.dataLayer, which GTM reads to control tag firing. Analytics tags are held until analytics consent is granted; marketing tags require marketing consent. ConsentStack's integration supports Google Consent Mode v2 signal passing.

Other Google Products

Firebase
Firebase
Firebase is Google's mobile and web application development platform offering authentication, real-time database, cloud functions, and analytics. Web SDK scripts initialize Firebase services and may track app events via Firebase Analytics, which is powered by Google Analytics 4. Widely used in single-page apps and PWAs for backend infrastructure and usage tracking.
Google Ads
Google Ads
Google Ads is Google's advertising platform for search, display, and remarketing campaigns. Conversion tracking scripts fire on advertiser landing pages to measure actions taken after ad clicks. The remarketing tag builds audience lists for retargeting users across Google's ad network.
Google Analytics
Google Analytics
Google Analytics is the world's most widely deployed web analytics platform. Scripts track page views, sessions, user demographics, traffic sources, and conversion events. Drops cookies to identify returning visitors and attribute user journeys across sessions.
Google Fonts
Google Fonts
Google Fonts is a free font hosting service that serves hundreds of typeface families via a global CDN. Stylesheets and font files load from fonts.googleapis.com and fonts.gstatic.com to deliver web fonts to visitors. No advertising or tracking functionality is included.
Google Maps
Google Maps
Google Maps is the dominant web mapping service used for embedded maps and location features on websites. Scripts load interactive map tiles, geocoding, and Places API functionality through the Maps JavaScript API. May set cookies to remember map preferences and manage API quota.
reCAPTCHA
reCAPTCHA
Google reCAPTCHA is a bot detection and spam prevention service protecting web forms, login pages, and checkout flows. Scripts analyze user behavior, mouse movements, and browser fingerprints to distinguish humans from bots. The invisible reCAPTCHA v3 scores interactions without requiring user challenges.
YouTube
YouTube
YouTube is Google's video platform, widely used to embed video content on external websites. The YouTube iframe player loads JavaScript that communicates with Google's servers for video playback, quality control, and ad serving. Embedded players may set cookies tied to the viewer's Google account to track watch history and personalize recommendations.
Google Search
Google Search
Google Search appears on websites through the Programmable Search Engine, enabling custom site-specific search functionality. Scripts load the search widget from Google's servers to render search bars and display results within the host website. Sends search queries to Google's index and may set cookies for search personalization and query history.
Sign in with Google
Sign in with Google
Sign in with Google is an OAuth-based authentication service that enables users to log into websites using their Google account credentials. Scripts load the Google Identity Services library, display sign-in buttons, and handle token exchange for secure authentication. Stores session tokens and authentication cookies to maintain login state across page visits.
YouTube Player
YouTube Player
YouTube Player embeds YouTube videos on external websites via iframe. Scripts load from Google's servers and set cookies for video playback preferences, watch history, and ad targeting. Cookies are dropped even when visitors only view the embed without interacting with the player.

Related Vendors

Firebase
Firebase
Firebase is Google's mobile and web application development platform offering authentication, real-time database, cloud functions, and analytics. Web SDK scripts initialize Firebase services and may track app events via Firebase Analytics, which is powered by Google Analytics 4. Widely used in single-page apps and PWAs for backend infrastructure and usage tracking.
Sign in with Google
Sign in with Google
Sign in with Google is an OAuth-based authentication service that enables users to log into websites using their Google account credentials. Scripts load the Google Identity Services library, display sign-in buttons, and handle token exchange for secure authentication. Stores session tokens and authentication cookies to maintain login state across page visits.
Google
Google
Google is the dominant provider of web analytics, advertising, and infrastructure tools. Scripts like Google Analytics, Tag Manager, Ads, and reCAPTCHA collect behavioral data, manage tag firing, serve targeted ads, and detect bots. Sets persistent cookies to track users and correlate activity across sites.
Google Fonts
Google Fonts
Google Fonts is a free font hosting service that serves hundreds of typeface families via a global CDN. Stylesheets and font files load from fonts.googleapis.com and fonts.gstatic.com to deliver web fonts to visitors. No advertising or tracking functionality is included.
reCAPTCHA
reCAPTCHA
Google reCAPTCHA is a bot detection and spam prevention service protecting web forms, login pages, and checkout flows. Scripts analyze user behavior, mouse movements, and browser fingerprints to distinguish humans from bots. The invisible reCAPTCHA v3 scores interactions without requiring user challenges.
Azure CDN
Azure CDN
Azure CDN is Microsoft's content delivery network that caches and serves website assets from globally distributed edge servers. Delivers HTML, CSS, JavaScript, images, and media to visitors from the nearest edge location to reduce latency. No tracking or advertising functionality — operates purely as transparent content delivery infrastructure.

Manage consent for Google Tag Manager

ConsentStack automatically detects and manages Google Tag Manager trackers so your site stays compliant with global privacy regulations.