Consent banner is present for cookie-based analytics
Why it matters
Deploying cookie-based analytics (GA4, Mixpanel, Amplitude, Segment) without a consent banner violates GDPR Art. 6 and Art. 7 for EU/EEA visitors and CCPA §1798.120 for California residents. Regulators treat the absence of a consent mechanism as a strict liability violation — no harm needs to be proved. DPA enforcement actions have resulted in fines up to 4% of global annual turnover. Beyond legal exposure, analytics data collected without lawful basis cannot be legally used and may need to be deleted entirely.
Severity rationale
Critical because collecting persistent tracking cookies without user consent is a per-visit GDPR violation with direct regulatory fine exposure under Art. 83.
Remediation
Integrate a consent management platform or build a minimal consent banner before loading any cookie-based analytics script. The simplest compliant path is a third-party CMP (CookieYes, Cookiebot) that handles jurisdiction detection and record-keeping automatically. If building in-house, gate analytics initialization inside the banner's accept handler:
// components/CookieBanner.tsx
'use client'
export function CookieBanner() {
return (
<div>
<p>We use analytics cookies to understand how visitors use this site.</p>
<button onClick={() => {
localStorage.setItem('analytics_consent', 'true')
initAnalytics()
}}>Accept</button>
<button onClick={() => localStorage.setItem('analytics_consent', 'false')}>Decline</button>
</div>
)
}
Alternatively, switch to a cookie-free tool (Plausible, Fathom) and eliminate the consent requirement entirely.
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 Analytics & Tracking Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- gdpr · Art. 6 — Lawfulness of processing
- gdpr · Art. 7 — Conditions for consent
- eprivacy · Art. 5(3) — Confidentiality of communications / cookie consent
- ccpa · §1798.120 — Right to opt-out of sale of personal information
Taxons
History
- 2026-04-18·v1.0.0·Initial import from marketing-analytics·automated