本文へ移動
cccskills
無料GitHub で公開

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.

インストール方法を見る

含まれるファイル(8)

  • SKILL.md10.4 KB
  • assets/consent_mode_gtag.html3.2 KB
  • assets/consent_mode_gtm.html1.1 KB
  • assets/consent_parameters.md785 B
  • assets/template.md2.6 KB
  • references/standards.md1.9 KB
  • references/workflows.md2.4 KB
  • scripts/process.py9.1 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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:

<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

<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

// 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:

// 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

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Implements 42 CFR Part 2 protections for substance use disorder patient records. Covers written consent requirements stricter than HIPAA, re-disclosure prohibition, court order procedures, qualified service organization agreements, and 2024 amendments aligning Part 2 with HIPAA. Keywords: 42 CFR Part 2, substance use disorder, SUD records, re-disclosure, consent, Part 2 amendments.

日本語の概要は準備中です。原文の説明を表示しています。

mukul975/Privacy-Data-Protection-Skills3032026年3月17日 更新

Guides assessment of third-country adequacy decisions under GDPR Article 45 for international data transfers. Covers the current EC adequacy decisions list, adequacy assessment criteria, partial adequacy handling, and monitoring of adequacy decision reviews. Keywords: adequacy decision, Article 45, third country, adequate protection, EC adequacy list.

日本語の概要は準備中です。原文の説明を表示しています。

mukul975/Privacy-Data-Protection-Skills3032026年3月17日 更新

Implements age-gating mechanisms for online services to restrict access based on user age. Covers hard gates versus soft gates, neutral age prompts, re-verification triggers, circumvention prevention, and regulatory requirements under GDPR, COPPA, UK Online Safety Act, and DSA. Keywords: age gate, age restriction, neutral prompt, children, online services, access control.

日本語の概要は準備中です。原文の説明を表示しています。

mukul975/Privacy-Data-Protection-Skills3032026年3月17日 更新

Evaluates and implements age estimation and verification technologies for online services. Covers facial age estimation, digital ID verification, self-declaration with risk assessment, AI-based age estimation, and the accuracy versus privacy tradeoff. Includes ICO guidance and euCONSENT framework. Keywords: age verification, age estimation, facial analysis, digital ID, children, online safety.

日本語の概要は準備中です。原文の説明を表示しています。

mukul975/Privacy-Data-Protection-Skills3032026年3月17日 更新

Preparing EU AI Act compliance documentation for high-risk AI systems. Covers Annex III classification, technical documentation under Art. 11, conformity assessment, risk management systems, and CE marking requirements. Keywords: EU AI Act, high-risk AI, Annex III, conformity assessment, CE marking.

日本語の概要は準備中です。原文の説明を表示しています。

mukul975/Privacy-Data-Protection-Skills3032026年3月17日 更新

Implements GDPR Art. 22 automated decision-making and AI Act Art. 14 human oversight requirements for AI systems. Covers identification of solely automated decisions, meaningful human intervention design, logic explanation mechanisms, and contestation procedures. Keywords: Art. 22, automated decision, human oversight, AI Act, profiling, contestation.

日本語の概要は準備中です。原文の説明を表示しています。

mukul975/Privacy-Data-Protection-Skills3032026年3月17日 更新

mukul975 のスキルをすべて見る

このスキルの問題を報告する