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.
/plugin marketplace add henkisdabro/wookstar-claude-code-plugins/plugin install ga-suite@wookstar-claude-code-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/consent-mode-implementation-examples.mdGA4 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):
ad_storage
analytics_storage
ad_user_data (NEW in v2)
ad_personalization (NEW in v2)
Additional Parameters:
personalization_storage
functionality_storage
security_storage
Basic Implementation (gtag.js):
Step 1: Set Default Consent State (BEFORE gtag.js)
<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
// 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:
<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:
gtag('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:
// 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:
DebugView Test:
analytics_storage = deniedanalytics_storage = grantedCheck Event Parameters:
gcs parameter (Google Consent State)Cookie Inspection:
_ga cookie_ga cookie setGTM Preview:
Chrome DevTools:
// Check current consent state
dataLayer.filter(item => item[0] === 'consent')
Measurement Protocol with Consent:
{
"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):
gtag('consent', 'default', {
'ad_storage': 'denied',
'analytics_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied'
});
Update After User Accepts:
gtag('consent', 'update', {
'ad_storage': 'granted',
'analytics_storage': 'granted',
'ad_user_data': 'granted',
'ad_personalization': 'granted'
});
Data Deletion: Admin → Data Deletion Requests → Create
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.