Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Expert guidance for GA4 privacy and compliance including GDPR, CCPA, Consent Mode v2, data deletion, and privacy settings. Use when implementing Consent Mode, ensuring GDPR compliance, handling data deletion requests, configuring consent banners, or implementing privacy-first tracking. Covers consent parameters (ad_user_data, ad_personalization), data retention, IP anonymization, and compliance workflows.
.claude/skills/microck-ga4-privacy-compliance/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | 92% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 117% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 127% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 95% | 0% |
| case-05 | ✓→✗ | ▼ Worse | 136% | 0% |
GA4 provides privacy-focused features for GDPR, CCPA, and global privacy regulations including Consent Mode, data controls, and compliance workflows.
Invoke this skill when:
What is Consent Mode: Google's API for communicating user consent status to GA4, Google Ads, and other Google tags.
Consent Parameters (v2):
Additional Parameters:
Basic Implementation (gtag.js):
Step 1: Set Default Consent State (BEFORE gtag.js)
html<script> // Set default consent to denied window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('consent', 'default', { 'ad_storage': 'denied', 'ad_user_data': 'denied', 'ad_personalization': 'denied', 'analytics_storage': 'denied' }); // Configure GA4 gtag('config', 'G-XXXXXXXXXX'); </script> <!-- Load gtag.js --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
Step 2: Update Consent After User Choice
javascript// When user accepts all cookies gtag('consent', 'update', { 'ad_storage': 'granted', 'ad_user_data': 'granted', 'ad_personalization': 'granted', 'analytics_storage': 'granted' }); // When user accepts only analytics gtag('consent', 'update', { 'ad_storage': 'denied', 'ad_user_data': 'denied', 'ad_personalization': 'denied', 'analytics_storage': 'granted' }); // When user denies all gtag('consent', 'update', { 'ad_storage': 'denied', 'ad_user_data': 'denied', 'ad_personalization': 'denied', 'analytics_storage': 'denied' });
GTM Implementation:
Method 1: Using Consent Mode Template
Method 2: Manual GTM Setup
Create Consent Initialization Tag:
html<script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('consent', 'default', { 'ad_storage': 'denied', 'analytics_storage': 'denied', 'ad_user_data': 'denied', 'ad_personalization': 'denied' }); </script>
Create Consent Update Tag (on user acceptance):
gtag('consent', 'update', ...)consent_granted)EU-Specific Consent:
javascriptgtag('consent', 'default', { 'ad_storage': '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', 'GB'] }); gtag('consent', 'default', { 'ad_storage': 'granted', 'analytics_storage': 'granted' }, { 'region': ['US-CA'] // California - CCPA });
When analytics_storage = "denied":
When analytics_storage = "granted":
Conversion Modeling: When consent denied, GA4 uses:
Path: Admin → Data Settings → Data Retention
Options:
Applies To:
Reset on New Activity:
GDPR Compliance:
User Right to Deletion (GDPR Article 17):
Deleting User Data:
Processing:
Best Practice:
GA4 Default Behavior:
Unlike Universal Analytics:
anonymize_ip parameter neededWhat It Enables:
Privacy Implications:
Enabling: Admin → Data Settings → Data Collection → Google Signals
Recommendation:
What Are Thresholds: GA4 applies thresholds to reports when:
When Applied:
Managing Thresholds:
Popular CMPs:
GTM CMP Templates: Most CMPs provide GTM templates:
Example: Cookiebot Integration
Requirements:
Implementation:
javascript// Detect GPC signal if (navigator.globalPrivacyControl) { gtag('consent', 'update', { 'ad_storage': 'denied', 'ad_user_data': 'denied', 'ad_personalization': 'denied', 'analytics_storage': 'granted' // Analytics OK, ads denied }); }
GTM Variable for GPC:
navigator.globalPrivacyControlVerification Steps:
analytics_storage = deniedanalytics_storage = grantedgcs parameter (Google Consent State)_ga cookie_ga cookie setChrome DevTools:
javascript// Check current consent state dataLayer.filter(item => item[0] === 'consent')
Measurement Protocol with Consent:
json{ "client_id": "client_123", "consent": { "ad_storage": "denied", "analytics_storage": "granted", "ad_user_data": "denied", "ad_personalization": "denied" }, "events": [...] }
Best Practice:
Consent Parameters (v2):
ad_storage: Advertising cookiesanalytics_storage: Analytics cookiesad_user_data: User data sharing (NEW)ad_personalization: Personalized ads (NEW)Set Default (Before Consent):
javascriptgtag('consent', 'default', { 'ad_storage': 'denied', 'analytics_storage': 'denied', 'ad_user_data': 'denied', 'ad_personalization': 'denied' });
Update After User Accepts:
javascriptgtag('consent', 'update', { 'ad_storage': 'granted', 'analytics_storage': 'granted', 'ad_user_data': 'granted', 'ad_personalization': 'granted' });
Data Deletion: Admin → Data Deletion Requests → Create
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | pass→pass | 14,317 | 11,013 | -23% | 1 | 1 | 0% | 3,005 | 5,576 | +86% | 0 | 0 | — |
case-02 | fail→fail | 18,352 | 13,022 | -29% | 1 | 1 | 0% | 3,028 | 5,461 | +80% | 0 | 0 | — |
case-03 | fail→pass | 16,044 | 12,356 | -23% | 1 | 1 | 0% | 2,750 | 5,285 | +92% | 0 | 0 | — |
case-04 | pass→pass | 7,764 | 5,692 | -27% | 1 | 1 | 0% | 1,423 | 4,223 | +197% | 0 | 0 | — |
case-05 | pass→fail | 16,329 | 18,021 | +10% | 1 | 1 | 0% | 2,677 | 6,316 | +136% | 0 | 0 | — |
case-06 | pass→fail | 12,918 | 9,708 | -25% | 1 | 1 | 0% | 2,054 | 4,663 | +127% | 0 | 0 | — |
case-07 | pass→pass | 12,919 | 11,276 | -13% | 1 | 1 | 0% | 2,139 | 5,041 | +136% | 0 | 0 | — |
case-08 | pass→pass | 10,442 | 6,994 | -33% | 1 | 1 | 0% | 1,680 | 4,313 | +157% | 0 | 0 | — |
case-09 | fail→pass | 14,687 | 12,227 | -17% | 1 | 1 | 0% | 2,427 | 5,257 | +117% | 0 | 0 | — |
case-10 | pass→pass | 14,217 | 12,925 | -9% | 1 | 1 | 0% | 2,335 | 5,464 | +134% | 0 | 0 | — |
case-11 | fail→pass | 15,061 | 12,265 | -19% | 1 | 1 | 0% | 2,379 | 5,405 | +127% | 0 | 0 | — |
case-12 | pass→pass | 14,313 | 10,329 | -28% | 1 | 1 | 0% | 2,475 | 5,013 | +103% | 0 | 0 | — |
case-13 | pass→pass | 11,287 | 10,166 | -10% | 1 | 1 | 0% | 1,867 | 4,948 | +165% | 0 | 0 | — |
case-14 | pass→pass | 19,882 | 17,539 | -12% | 1 | 1 | 0% | 3,210 | 6,080 | +89% | 0 | 0 | — |
case-15 | pass→pass | 19,631 | 21,126 | +8% | 1 | 1 | 0% | 3,408 | 6,822 | +100% | 0 | 0 | — |
case-16 | pass→pass | 12,453 | 7,015 | -44% | 1 | 1 | 0% | 2,346 | 4,511 | +92% | 0 | 0 | — |
case-17 | pass→pass | 11,380 | 5,217 | -54% | 1 | 1 | 0% | 1,968 | 4,100 | +108% | 0 | 0 | — |
case-18 | pass→pass | 7,872 | 6,580 | -16% | 1 | 1 | 0% | 1,471 | 4,418 | +200% | 0 | 0 | — |
case-19 | fail→pass | 13,014 | 5,434 | -58% | 1 | 1 | 0% | 2,094 | 4,080 | +95% | 0 | 0 | — |
case-20 | pass→pass | 13,826 | 11,483 | -17% | 1 | 1 | 0% | 2,562 | 5,359 | +109% | 0 | 0 | — |
case-21 | pass→pass | 11,342 | 10,101 | -11% | 1 | 1 | 0% | 2,124 | 5,153 | +143% | 0 | 0 | — |
case-22 | pass→pass | 11,070 | 11,011 | -1% | 1 | 1 | 0% | 2,325 | 5,492 | +136% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +9 percentage points is the difference between those two pass rates over the 22 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.