Analytics configured with IP masking; no user IDs sent without explicit consent
Why it matters
GDPR Art. 25 (data protection by design) requires that analytics configurations minimize data collection by default — and the default GA4 configuration does not do this. Without Consent Mode v2 and analytics_storage: 'denied' as the default state, GA4 collects full IP addresses and sets cookies before any user consent is obtained. ePrivacy Art. 5(3) makes this unlawful for EU users without prior consent. ISO-27001:2022 A.5.34 requires that privacy controls be applied at the point of processing, not as an afterthought. Passing raw user email to analytics.identify() also creates a direct PII leak to a third-party processor — this is an Art. 28 issue on top of the consent failure.
Severity rationale
Info because misconfigured analytics is a procedural privacy failure rather than a direct security vulnerability, but regulators treat it as a consent mechanism failure and issue fines accordingly.
Remediation
Initialize GA4 with Consent Mode v2 so analytics is denied by default and only activates after the user accepts in the consent banner.
// In your <head>, before the GA4 script tag loads:
window.dataLayer = window.dataLayer || []
function gtag(...args: unknown[]) { window.dataLayer.push(args) }
// Deny all by default
gtag('consent', 'default', {
analytics_storage: 'denied',
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
})
// Call after user accepts analytics in the consent banner:
gtag('consent', 'update', { analytics_storage: 'granted' })
For identity calls, pass a pseudonymous ID (see pii-separation pattern) never the raw email. If migrating is complex, consider switching to Plausible or Fathom — both are GDPR-compliant by design with no cookies, no IP storage, and no consent banner requirement for basic analytics.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Data Protection Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- gdpr · Art. 25 — Data protection by design and by default
- gdpr · Art. 32 — Security of processing — appropriate technical measures
- eprivacy · Art. 5(3) — Consent required before storing or accessing information on terminal equipment
- iso-27001:2022 · A.5.34 — Privacy and protection of PII
Taxons
History
- 2026-04-18·v1.0.0·Initial import from data-protection·automated