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.

Is Google Tag Manager GDPR compliant?

Google Tag Manager typically loads analytics trackers, which are not strictly necessary for your site to work. Under the GDPR and the ePrivacy Directive, non-essential cookies and trackers must stay blocked until a visitor gives clear opt-in consent. So Google Tag Manager can be fully GDPR compliant, but only if your site holds its scripts until consent is granted and lets visitors decline just as easily. Compliance depends on how your site loads Google Tag Manager, not on Google Tag Manager itself.

Visit website

Consent Categories

Also Known As

GTMgtm.jsGoogle Tag Manager GDPRtag management consentcontainer script

Industries

Computers Electronics and TechnologySearch Engines

Tracked Domains (2)

Google Tag Manager's trackers are very common, seen on about 65% of the sites ConsentStack has scanned. Scan your own site to see which of these are firing before consent.

Want a focused check? Use the Google Analytics checker to see whether Google Tag Manager loads before consent on your site and whether it meets GDPR and CCPA.

googletagmanager.comAnalytics

googletagmanager.com is an analytics domain operated by Google Tag Manager, used to measure visits, sessions, and on-site behavior. Seen on about 65% of scanned sites.

googletagservices.comAnalytics

googletagservices.com is an analytics domain operated by Google Tag Manager, used to measure visits, sessions, and on-site behavior. Seen on about 3% of scanned sites.

Frequently Asked Questions

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

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.
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 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.
ImageKit
ImageKit
ImageKit is an image CDN and optimization service that serves transformed images from edge servers. Its scripts handle URL-based image transformations including resizing, format conversion, and lazy loading. ImageKit makes network requests to its CDN endpoints but does not typically set tracking cookies.
Cloudflare
Cloudflare
CDN and network security infrastructure provider used to accelerate and protect websites. Scripts include the Cloudflare Turnstile CAPTCHA widget, Web Analytics (cookieless analytics), and Bot Management signals. Core CDN functionality operates at the network level, but challenge and analytics scripts do execute in the browser.
Directus
Directus
Directus is an open-source headless CMS and data platform that serves structured content via APIs. Its backend delivers content to frontend applications through REST or GraphQL endpoints. Directus does not typically load tracking scripts in the browser, functioning primarily as a server-side content source.

Manage consent for Google Tag Manager

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