Agent skill

Google Consent Mode V2

by mukul975 in mukul975/Privacy-Data-Protection-Skills

Configuring Google Consent Mode v2 for privacy-compliant measurement and advertising.

Apache-2.0Auto-check passedMarketing & SEO

Install Google Consent Mode V2

skills CLI
$ npx skills add mukul975/Privacy-Data-Protection-Skills --skill google-consent-mode-v2 -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mukul975/Privacy-Data-Protection-Skills google-consent-mode-v2 --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mukul975/Privacy-Data-Protection-Skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/privacy/google-consent-mode-v2 .claude/skills/google-consent-mode-v2 && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
google-consent-mode-v2
GitHub stars
301
Token cost
~2.6k tokens
SKILL.md length
921 words
Files
8 (incl. scripts, references, assets)
Skills in repo
280
Repo updated
First seen
Licence
Apache-2.0

At a glance

Configuring Google Consent Mode v2 for privacy-compliant measurement and advertising.

  • Works in 3 steps: Default consent fires before tags: Check… → Update consent fires on CMP interaction:… → Tag behavior matches consent state:…
  • Tasks that involve Paid advertising
  • SKILL.md covers Overview, Consent Mode v2 Parameters, Implementation and Conversion Modeling and…, plus 3 more sections
  • Runs Python scripts from its folder; reaches google-analytics.com and googletagmanager.com

What it does

Google Consent Mode V2 is an agent skill from mukul975/Privacy-Data-Protection-Skills. 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.

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 10 other files, including scripts, reference files and assets (for example `assets/consent_parameters.md`, `assets/template.md` and `references/standards.md`).

It sits in Marketing & SEO, covering Paid advertising and Privacy and GDPR. It works with Google Analytics and Google Ads. The repository describes itself as: 282+ structured privacy & data protection skills for AI agents. GDPR, CCPA, EU AI Act, HIPAA, LGPD, PIPL, DPDP Act. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Paid advertising
  • Tasks that involve Privacy and GDPR

Example prompts

  • “/google-consent-mode-v2”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  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

What it can do on your machine

Read from SKILL.md and the folder at commit 9b2ef9e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • google-analytics.com
    • googletagmanager.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Google Consent Mode V2 loads about 2.6k tokens when it runs, and up to ~3.7k if it reads all its reference files. Until then it costs about 69 tokens; SKILL.md has 921 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~69
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from mukul975/Privacy-Data-Protection-Skills at commit 9b2ef9e, republished under its Apache-2.0 licence (© mukul975). 921 words, ~2,645 tokens.

Download SKILL.mdSave it as .claude/skills/google-consent-mode-v2/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
google-consent-mode-v2
description
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.
license
Apache-2.0
metadata.author
mukul975
metadata.version
1.0
metadata.domain
privacy
metadata.subdomain
cookie-consent-compliance
metadata.tags
google-consent-mode, ga4, google-ads, conversion-modeling, eea-compliance

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.

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)

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

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
Show full SKILL.md (372 more words)Show less
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

© mukul975, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (scripts, references, assets) in skills/privacy/google-consent-mode-v2 of mukul975/Privacy-Data-Protection-Skills.

  • SKILL.md
  • assets/consent_mode_gtag.html
  • assets/consent_mode_gtm.html
  • assets/consent_parameters.md
  • assets/template.md
  • references/standards.md
  • references/workflows.md
  • scripts/process.py

Open the folder on GitHubat commit 9b2ef9e

Compare with similar skills

Google Consent Mode V2 next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Google Consent Mode V2 compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Google Consent Mode V2 this skillmukul975/Privacy-Data-Protection-Skills301—~2.6kAutomated safety check: PassApache-2.0
Ad Conversion Tracking Setupminhnv0807/ai-business-skills609—~3.7kAutomated safety check: PassMIT
Blog GoogleAgriciDaniel/claude-blog2.3k1 repos~3.3kAutomated safety check: NotesMIT
SEO Googleseranking/seo-skills161—~4.8kAutomated safety check: PassMIT
Google Adsarnabbagxd/Brand-building-skills729—~3.1kAutomated safety check: PassMIT
Google Analytics Admin API Basicsgoogle/skills21k—~1.9kAutomated safety check: PassApache-2.0

Similar skills

  • Ad Conversion Tracking Setup

    minhnv0807/ai-business-skills

    Sets up and verifies conversion tracking before ad spend: Meta Pixel and CAPI, Google Ads, GA4, TikTok, server-side GTM, consent mode, UTMs and a pre-launch checklist.

    609 GitHub stars~3.7k tokensUpdated 28 days ago
    Marketing & SEOAuto-check passed
  • Blog Google

    AgriciDaniel/claude-blog

    Google API integration for blog performance: PageSpeed Insights, CrUX Core Web Vitals with 25-week history, Search Console performance, URL Inspection, Indexing API, GA4 organic traffic, NLP entity…

    2.3k GitHub starsUsed in 1 repo~3.3k tokens
    Marketing & SEOAuto-check: notes
  • SEO Google

    seranking/seo-skills

    Direct access to Google's own SEO data via Search Console (Search Analytics, URL Inspection, Sitemaps), PageSpeed Insights v5, CrUX field data with 25-week history, Indexing API v3, GA4 organic…

    161 GitHub stars~4.8k tokensUpdated 3 mo ago
    Marketing & SEOAuto-check passed
  • Google Ads

    arnabbagxd/Brand-building-skills

    Plan, build, and optimize Google Ads campaigns — Search, Shopping, Performance Max, Display, and YouTube — including keyword research, match types, bidding strategy, Quality Score, ad extensions…

    729 GitHub stars~3.1k tokensUpdated 3 mo ago
    Marketing & SEOAuto-check passed
  • Official

    Manages Google Analytics account and property settings, enables the Analytics Admin API via the Cloud CLI, lists accounts and properties, and manages data streams, custom dimensions, conversion…

    21k GitHub stars~1.9k tokensUpdated today
    Marketing & SEOAuto-check passed
  • Official

    Guides developers through implementing event and conversion ingestion to Google products using the Data Manager API /v1/events/ingest endpoint and its associated client libraries.

    21k GitHub stars~2.8k tokensUpdated today
    Marketing & SEOAuto-check passed

More from mukul975/Privacy-Data-Protection-Skills

All 280 skills in this repo
  • Age Gating Services

    mukul975/Privacy-Data-Protection-Skills

    Implements age-gating mechanisms for online services to restrict access based on user age.

    301 GitHub stars~3.7k tokensUpdated 6 mo ago
    Auto-check passed
  • AI Data Retention

    mukul975/Privacy-Data-Protection-Skills

    Manages AI model retention and machine unlearning requirements.

    301 GitHub stars~1.9k tokensUpdated 6 mo ago
    Auto-check passed
  • AI Dpia

    mukul975/Privacy-Data-Protection-Skills

    Conducts Data Protection Impact Assessments for AI and ML systems per EDPB Guidelines 04/2025 on AI processing.

    301 GitHub stars~3.4k tokensUpdated 6 mo ago
    Auto-check passed
  • Dpia Mitigation Plan

    mukul975/Privacy-Data-Protection-Skills

    Structures risk mitigation planning and residual risk tracking for Data Protection Impact Assessments under GDPR Article 35(7)(d).

    301 GitHub stars~846 tokensUpdated 6 mo ago
    Auto-check passed
  • Gdpr Accountability

    mukul975/Privacy-Data-Protection-Skills

    Guides implementation of the GDPR accountability principle under Articles 5(2) and 24, including documentation requirements for policies, DPIAs, RoPA, training records, and breach logs.

    301 GitHub stars~1.9k tokensUpdated 6 mo ago
    Auto-check passed
  • Pia Threshold Screening

    mukul975/Privacy-Data-Protection-Skills

    Conducts pre-DPIA threshold screening to determine whether a full Data Protection Impact Assessment is required under GDPR Article 35.

    301 GitHub stars~880 tokensUpdated 6 mo ago
    Auto-check passed

Questions about Google Consent Mode V2

What does Google Consent Mode V2 do?

Configuring Google Consent Mode v2 for privacy-compliant measurement and advertising. Google Consent Mode V2 is an agent skill from mukul975/Privacy-Data-Protection-Skills. Configuring Google Consent Mode v2 for privacy-compliant measurement and advertising.

When should I use Google Consent Mode V2?

Google Consent Mode V2 fits situations like: tasks that involve Paid advertising; tasks that involve Privacy and GDPR.

How do I install Google Consent Mode V2 in Claude Code?

Run `npx skills add mukul975/Privacy-Data-Protection-Skills --skill google-consent-mode-v2 -a claude-code`. Or copy the skill folder (skills/privacy/google-consent-mode-v2 in mukul975/Privacy-Data-Protection-Skills) into .claude/skills/google-consent-mode-v2 in your project. Claude Code loads it when a task matches its description.

How do I install Google Consent Mode V2 in Codex?

Run `npx skills add mukul975/Privacy-Data-Protection-Skills --skill google-consent-mode-v2 -a codex`. Or copy the skill folder (skills/privacy/google-consent-mode-v2 in mukul975/Privacy-Data-Protection-Skills) into .agents/skills/google-consent-mode-v2 in your project. Codex loads it when a task matches its description.

Can I use Google Consent Mode V2 in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mukul975/Privacy-Data-Protection-Skills --skill google-consent-mode-v2 -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/google-consent-mode-v2, .gemini/skills/google-consent-mode-v2, .github/skills/google-consent-mode-v2 and .opencode/skills/google-consent-mode-v2 in your project.

What does Google Consent Mode V2 need to run?

Going by SKILL.md and its folder, Google Consent Mode V2 needs Python for the scripts in its folder. Our summary lists: Python 3.

Does Google Consent Mode V2 access the network?

SKILL.md names 2 domains. In commands or code: google-analytics.com and googletagmanager.com; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.

Is Google Consent Mode V2 safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Google Consent Mode V2 use?

Google Consent Mode V2 is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Google Consent Mode V2 use?

About 2.6k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.1k tokens, read only when the agent opens those files.

What are the alternatives to Google Consent Mode V2?

Skills that share tags, products or a category with Google Consent Mode V2: Ad Conversion Tracking Setup (minhnv0807/ai-business-skills, 609 stars), Blog Google (AgriciDaniel/claude-blog, 2.3k stars), SEO Google (seranking/seo-skills, 161 stars) and Google Ads (arnabbagxd/Brand-building-skills, 729 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Google Consent Mode V2?

mukul975 (a GitHub user) maintains it in mukul975/Privacy-Data-Protection-Skills, which has 301 GitHub stars. The repository holds 280 skills in this directory. The repository was last updated on March 16, 2026.

Source: mukul975/Privacy-Data-Protection-Skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.