Google Consent Mode V2 logo

Google Consent Mode V2

Community
mukul975
google-consent-mode-v2

Configuring Google Consent Mode v2 for privacy-compliant measurement and advertising. Covers default and update commands, consent state mapping to GA4 and Google Ads, conversion modeling with cookieless pings, and EEA requirements effective March 2024.

Overview

Publishermukul975
RepositoryPrivacy-Data-Protection-Skills
Skill namegoogle-consent-mode-v2
Stars
279
Forks
59
Bundled files
7
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 7 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by mukul975 on GitHub. Read the source before you install it.

Installation

Install the Google Consent Mode V2 AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mukul975/Privacy-Data-Protection-Skills.git /tmp/Privacy-Data-Protection-Skills
mkdir -p .claude/skills
cp -r /tmp/Privacy-Data-Protection-Skills/plugins/cookie-consent-skills/skills/google-consent-mode-v2 .claude/skills/google-consent-mode-v2
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Google Consent Mode V2 in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Google Consent Mode V2 on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Google Consent Mode V2 is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Configuring Google Consent Mode v2

Overview

Google Consent Mode v2 is a framework that adjusts the behavior of Google tags (Analytics, Ads, Floodlight) based on user consent status. Announced in November 2023 with enforcement beginning March 2024, Consent Mode v2 introduces two new parameters — ad_user_data and ad_personalization — alongside the existing analytics_storage and ad_storage parameters. For advertisers serving users in the European Economic Area (EEA), implementing Consent Mode v2 is required to maintain measurement and audience capabilities in Google Ads and GA4. Without it, Google will not process EEA user data for remarketing lists or conversion measurement.

Consent Mode v2 Parameters

Parameter Definitions

ParameterControlsDefaultDescription
ad_storageAdvertising cookiesdeniedControls whether advertising-related cookies (gcl*, IDE) can be read/written
ad_user_dataUser data for advertisingdeniedControls whether user data can be sent to Google for advertising purposes
ad_personalizationAd personalizationdeniedControls whether data can be used for remarketing and personalized ads
analytics_storageAnalytics cookiesdeniedControls whether analytics cookies (_ga, _gid) can be read/written
functionality_storageFunctionality cookiesgrantedControls functionality cookies (language preferences)
personalization_storagePersonalization cookiesdeniedControls personalization cookies (recommendations)
security_storageSecurity cookiesgrantedControls security-related cookies (authentication, fraud prevention)

Consent State Mapping for Pinnacle E-Commerce Ltd

Map CMP consent categories to Consent Mode parameters:

CMP Categoryad_storagead_user_dataad_personalizationanalytics_storage
All rejected (default)denieddenieddenieddenied
Analytics onlydenieddenieddeniedgranted
Analytics + Advertisinggrantedgrantedgrantedgranted
Analytics + Advertising (no personalization)grantedgranteddeniedgranted
All acceptedgrantedgrantedgrantedgranted

Implementation

Basic Implementation (Google Tag / gtag.js)

Step 1: Set defaults before any Google tags load

Place this script in the <head> before the Google tag:

html
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}

// Set default consent state — deny all non-essential before user interaction
gtag('consent', 'default', {
  'ad_storage': 'denied',
  'ad_user_data': 'denied',
  'ad_personalization': 'denied',
  'analytics_storage': 'denied',
  'functionality_storage': 'granted',
  'personalization_storage': 'denied',
  'security_storage': 'granted',
  'wait_for_update': 500  // Wait 500ms for CMP to load
});

// Enable URL passthrough for conversion measurement without cookies
gtag('set', 'url_passthrough', true);

// Enable ads data redaction when ad_storage is denied
gtag('set', 'ads_data_redaction', true);
</script>

Step 2: Load the Google tag

html
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PINNACLE123"></script>
<script>
gtag('js', new Date());
gtag('config', 'G-PINNACLE123');
</script>

Step 3: Update consent state when user interacts with CMP

javascript
// Called by the CMP when user makes a consent choice
function updateGoogleConsent(consentState) {
  gtag('consent', 'update', {
    'ad_storage': consentState.advertising ? 'granted' : 'denied',
    'ad_user_data': consentState.advertising ? 'granted' : 'denied',
    'ad_personalization': consentState.personalization ? 'granted' : 'denied',
    'analytics_storage': consentState.analytics ? 'granted' : 'denied'
  });
}

Google Tag Manager Implementation

Step 1: Configure Consent Initialization trigger

In GTM, use the "Consent Initialization — All Pages" trigger type for the default consent tag. This fires before all other triggers.

Default Consent Tag (Consent Initialization trigger):

SettingValue
Tag typeGoogle tag: Consent configuration
ActionDefault
ad_storageDenied
ad_user_dataDenied
ad_personalizationDenied
analytics_storageDenied
Wait for update500 ms
URL passthroughEnabled
Ads data redactionEnabled

Step 2: Configure Consent Update tag

Create a custom HTML tag or use a CMP-specific template that fires on consent change:

Update Consent Tag (Custom Event trigger: consent_update):

SettingValue
Tag typeGoogle tag: Consent configuration
ActionUpdate
ad_storage{{CMP - Ad Storage Consent}}
ad_user_data{{CMP - Ad User Data Consent}}
ad_personalization{{CMP - Ad Personalization Consent}}
analytics_storage{{CMP - Analytics Storage Consent}}

Step 3: Configure tag consent settings

For each Google tag in GTM, configure the built-in consent checks:

TagRequired ConsentAdditional Consent
GA4 Configurationanalytics_storage
GA4 Eventanalytics_storage
Google Ads Conversionad_storagead_user_data
Google Ads Remarketingad_storagead_user_data, ad_personalization
Floodlight Counterad_storagead_user_data
Floodlight Salesad_storagead_user_data

Region-Specific Settings

Apply different defaults based on user geography:

javascript
// Strict defaults for EEA users
gtag('consent', 'default', {
  'ad_storage': 'denied',
  'ad_user_data': 'denied',
  'ad_personalization': 'denied',
  'analytics_storage': 'denied',
  'region': ['AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR',
             'DE', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT', 'NL',
             'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'IS', 'LI', 'NO']
});

// Less restrictive defaults for US users (adjust per state law)
gtag('consent', 'default', {
  'ad_storage': 'granted',
  'ad_user_data': 'granted',
  'ad_personalization': 'granted',
  'analytics_storage': 'granted',
  'region': ['US']
});

Conversion Modeling and Cookieless Pings

How Consent Mode Preserves Measurement

When consent is denied, Google tags still send cookieless pings that include:

  • Page URL (with ads_data_redaction applied)
  • Timestamp
  • User agent
  • Referrer (if ads_data_redaction is false)
  • Aggregate consent state

Google uses these pings, combined with data from consenting users, to build machine learning models that estimate:

  • Conversion modeling: Estimated conversions from users who did not consent to ad_storage
  • Behavioral modeling in GA4: Estimated user counts and session metrics for non-consenting users

Conversion Modeling Requirements

For Google to generate modeled conversions, Pinnacle E-Commerce Ltd must meet:

RequirementThreshold
Minimum consented conversions per day70+ per conversion action
Minimum total conversions per day100+ per conversion action
Consent Mode implemented forAt least 7 consecutive days
Tag coverageAll conversion-relevant pages

GA4 Behavioral Modeling

GA4 behavioral modeling fills gaps in analytics data:

RequirementThreshold
Minimum daily consented users1,000+ per property
Minimum days of data7+ consecutive days
Consent Mode coverageAll GA4 pageview and event tags

Verification and Debugging

Google Tag Assistant Verification

Use Google Tag Assistant (browser extension) to verify:

  1. Default consent fires before tags: Check that consent defaults appear before the Google tag configuration in the Tag Assistant timeline
  2. Update consent fires on CMP interaction: Verify consent update events appear when the user interacts with the cookie banner
  3. Tag behavior matches consent state: Confirm that GA4 and Ads tags fire (or are blocked) based on consent

Real-Time Debugging

In GA4 DebugView, consent-impacted events display with:

  • A "consent" badge showing current consent state
  • Missing user/session IDs when analytics_storage is denied
  • Cookieless ping indicators

Network-Level Verification

Monitor network requests to https://www.google-analytics.com/g/collect:

ParameterConsent GrantedConsent Denied
_p (Page ID)PresentPresent
cid (Client ID)From _ga cookieRandomly generated per-hit
gcs (Consent State)G111 (all granted)G100 (all denied)
gcd (Consent Default)PresentPresent
Cookie set_ga, _gidNone

EEA Requirements (March 2024)

Google's Digital Markets Act (DMA) compliance requirements:

  1. Consent Mode v2 mandatory: All advertisers targeting EEA users must implement Consent Mode v2 to maintain remarketing lists and conversion measurement
  2. ad_user_data and ad_personalization required: The two new v2 parameters must be set; omitting them is treated as "denied"
  3. Verified CMP recommended: Google recommends using a Google-certified CMP partner for EU consent collection
  4. Enhanced Conversions with consent: Enhanced Conversions (first-party data matching) requires ad_user_data = granted

Key References

  • Google Consent Mode v2 Documentation — Official implementation guide
  • Google Tag Manager Consent Configuration — GTM-specific setup instructions
  • Google Ads DMA Compliance Guide (March 2024) — EEA-specific requirements
  • EU Digital Markets Act (DMA) Regulation 2022/1925 — Legal basis for Google's consent requirements
  • ePrivacy Directive 2002/58/EC, Article 5(3) — Cookie consent legal basis
  • CJEU Case C-673/17 (Planet49) — Active consent requirements applicable to consent mode default states

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Google Consent Mode V2 AI skill do?

Configuring Google Consent Mode v2 for privacy-compliant measurement and advertising. Covers default and update commands, consent state mapping to GA4 and Google Ads, conversion modeling with cookieless pings, and EEA requirements effective March 2024.

Why use Google Consent Mode V2 on TypingMind?

Because you install it once and use it with any model. Google Consent Mode V2 is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Google Consent Mode V2 in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/mukul975/Privacy-Data-Protection-Skills/tree/main/plugins/cookie-consent-skills/skills/google-consent-mode-v2. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Google Consent Mode V2?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Google Consent Mode V2?

As many as you like. As long as a model supports skills, you can use Google Consent Mode V2 with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Google Consent Mode V2 AI skill free?

Yes. It is published on GitHub by mukul975 under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇