How Cookies Work with Google Tag Manager (GTM)

Discover how Google Tag Manager uses cookies, the role of consent, and how to stay compliant with privacy laws.

K
Kurabiye Team Privacy Engineering
Published
5 min read
Last updated
How cookies work with Google Tag Manager

Google Tag Manager appears on millions of websites, making it one of the most widely used tag management tools available. A common question arises: does GTM itself use cookies? The answer requires understanding what GTM actually does and how it interacts with other tracking technologies.

What Is Google Tag Manager and How It Works

Google Tag Manager is a tag management system. It acts as a container that holds and manages tracking scripts, pixels, and other code snippets that would otherwise need to be added directly to website code. Tags, triggers, and variables work together within GTM to control when and how these scripts execute.

The important distinction: GTM is a management layer, not a tracking tool itself. It organizes and deploys other technologies rather than collecting data directly.

Does Google Tag Manager Use Cookies?

GTM does not set cookies by default. The container script itself runs without creating any cookies on visitor browsers. However, this does not mean a website using GTM is cookie-free.

Cookies appear when the tags deployed through GTM set them. Google Analytics creates its own cookies. Facebook Pixel creates its own cookies. Advertising platforms create their own cookies. GTM simply provides the infrastructure for these tools to run.

This distinction matters for privacy compliance. The tags inside GTM, not GTM itself, determine what data is collected and what cookies are set.

How Cookies Are Set Through GTM Tags

When a tag fires through GTM, it behaves exactly as it would if added directly to website code. A Google Analytics 4 tag creates the same cookies whether deployed through GTM or hardcoded into a page. The management layer does not change this behavior.

Common tags and their cookie behaviors:

  • Google Analytics 4: Creates _ga and _gid cookies for visitor identification
  • Google Ads: Creates conversion tracking and remarketing cookies
  • Facebook Pixel: Creates _fbp cookies for advertising purposes
  • LinkedIn Insight: Creates tracking cookies for B2B analytics

Each tag maintains its own cookie policy and data collection practices. GTM coordinates when these tags run but does not modify what they do once active.

Consent becomes critical when deploying tracking tags through GTM. Privacy regulations require visitor permission before setting non-essential cookies. GTM provides mechanisms to honor these consent requirements.

The standard approach involves trigger modifications. Tags can be configured to fire only when consent has been granted. This requires integrating consent signals from a CMP with GTM trigger conditions.

Google Consent Mode offers another path. This feature allows tags to adjust their behavior based on consent status. When consent is denied, tags can operate in a limited mode that respects visitor preferences while maintaining some measurement capability.

Google Consent Mode v2 introduces standardized consent signals that Google tags understand natively. The consent state includes multiple parameters:

  • ad_storage: Controls advertising cookies
  • analytics_storage: Controls analytics cookies
  • ad_user_data: Controls sending user data to Google for advertising
  • ad_personalization: Controls personalized advertising

When a CMP communicates these consent states to GTM, Google tags automatically adjust their behavior. Denied consent means cookies are not set and data is not stored in ways that could identify individuals.

Third-party tags outside the Google ecosystem may not respond to Consent Mode signals. These require additional configuration through trigger conditions or blocking rules.

Best Practices for GTM and Cookies

Managing cookies effectively in GTM requires attention to several areas.

Audit all tags regularly. Understanding what each tag does and what cookies it creates forms the foundation of compliance. Unknown tags mean unknown data collection.

Configure consent-based triggers. Every non-essential tag should have a trigger condition tied to consent status. This ensures tracking only occurs when visitors have granted permission.

Test consent flows thoroughly. Verify that tags actually respect consent states. Browser developer tools can show which cookies are created and when, revealing any gaps in consent enforcement.

Document tag purposes. Maintaining clear records of why each tag exists and what data it collects supports both compliance and efficient tag management.

FAQ

Does Google Tag Manager use cookies by default?

No. GTM itself does not set cookies. Cookies are created by the individual tags deployed through GTM, such as Google Analytics or advertising pixels.

How do cookies work with Google Tag Manager?

GTM manages when tags fire. Those tags, not GTM itself, create cookies. GTM can control tag firing based on consent status to manage cookie creation.

Which cookies are set through Google Tag Manager?

The cookies depend on deployed tags. Common examples include Google Analytics cookies (_ga, _gid) and advertising cookies from various platforms.

Consent is required for the tracking tags deployed through GTM, not for GTM itself. Non-essential cookies need visitor permission under regulations like GDPR.

Consent Mode allows Google tags to receive consent signals and adjust behavior automatically. Tags modify their operation based on whether consent has been granted.

Can Google Tag Manager work without cookies?

GTM operates without cookies. However, most tags deployed through it create cookies. Cookieless tracking modes exist for some Google services with reduced functionality.

How do third-party tags in GTM use cookies?

Each third-party tag follows its own cookie policy. GTM controls when tags fire but does not change how those tags create or use cookies once active.

What is the difference between GTM cookies and GA4 cookies?

GTM does not create cookies. GA4 creates specific cookies for analytics purposes. The distinction is between the management layer and the tracking tool.

Is Google Tag Manager GDPR compliant on its own?

GTM as a tool is neutral. GDPR compliance depends on how tags are configured and whether proper consent mechanisms are in place before tracking occurs.

Related Articles

Free tier available

Ready to upgrade your
infrastructure?

Join the forward-thinking companies building a more respectful internet.

SOC 2 Compliant GDPR Ready 99.9% Uptime