Quick Summary
- Non-essential cookies must be blocked until the user explicitly opts in.
- Accept and Reject buttons must have equal visual prominence.
- Consent must be freely given, cookie walls are illegal.
- The banner must actually block scripts, not just display a notice.
Introduction
Cookie consent banners are ubiquitous on the web, and most of them are non-compliant. The problem is not that websites lack a banner, but that their banners do not actually work. Scripts fire before consent is given, reject options are hidden behind extra clicks, and accept buttons are visually emphasized to manipulate user choice.
Under the ePrivacy Directive and GDPR, cookie consent is not a formality, it is a legal requirement with real enforcement. France's CNIL has issued over €200 million in fines specifically for non-compliant cookie consent implementations. And it is not just large companies: small businesses, individual professionals, and startups have been fined too.
This guide explains what a legally compliant cookie consent mechanism looks like, the dark patterns that make banners non-compliant, and exactly how to build a banner that satisfies regulators while still allowing you to use cookies and trackers for legitimate purposes. For official guidelines, refer to the European Data Protection Board (EDPB) Guidelines on consent.
What Is Cookie Consent?
The Legal Definition
Under EU law, you need explicit consent before dropping non-essential cookies on a user's device. “Non-essential” means any cookie not strictly required for the core functionality the user requested, this includes analytics, advertising, session replay, and social media trackers.
Valid consent under the GDPR has five requirements:
| Requirement | What It Means | Common Violation |
|---|---|---|
| Freely given | The user can refuse without consequences | Cookie walls that block content |
| Specific | Consent is given per purpose, not a blanket 'I agree' | Single 'Accept All' button only |
| Informed | The user knows what they are consenting to | No explanation of cookie purposes |
| Unambiguous | A clear affirmative action (click, check) | Implied consent via scrolling |
| Withdrawable | User can change their mind at any time | No way to revoke consent later |
Why It Matters
Enforcement and Trust
- Active enforcement: EU regulators are using automated scanning tools to detect non-compliant banners at scale. This is not theoretical, fines are being issued regularly.
- Significant fines: Google received €150M, Amazon €35M, and Criteo €40M specifically for cookie consent violations.
- Dark pattern crackdowns: The EDPB (European Data Protection Board) has released specific guidelines on what constitutes a dark pattern in consent interfaces. Violations are actively pursued.
- User trust: A manipulative consent banner signals to privacy-conscious users that you do not respect their choices, damaging brand perception.
- Enterprise readiness: B2B buyers increasingly evaluate vendor cookie compliance during procurement. A non-compliant banner can disqualify you from enterprise sales.
The Correct Consent Flow
The correct flow is simple but critical:
- Page loads → Only essential scripts (e.g., authentication, server-side rendering) execute.
- Consent banner appears → Shows cookie categories with equal Accept and Reject options.
- User makes a choice → Their preference is stored in a first-party cookie.
- If accepted → Non-essential scripts (analytics, ads) fire dynamically.
- If rejected → Non-essential scripts remain blocked indefinitely.
The Key Requirement
Check if your consent banner is actually blocking scripts.
Run Cookie Consent CheckReal-World Enforcement
| Organization | Fine | Violation |
|---|---|---|
| Google (France) | €150M | Reject option required more clicks than Accept |
| Amazon (France) | €35M | Cookies dropped before consent was given |
| Criteo | €40M | Cross-site tracking without valid opt-in |
| TikTok (France) | €5M | Reject option not equally prominent |
| Microsoft (France) | €60M | Non-essential cookies placed without consent |
Pattern: Equal Button Prominence
How to Detect Non-Compliance
- Test before consent: Open your site in an incognito window. Before clicking the consent banner, check DevTools → Application → Cookies and Network tab. If non-essential cookies or analytics requests appear, your banner is non-functional.
- Test rejection: Click “Reject All” and check whether analytics/ad cookies still appear. If they do, your rejection mechanism is broken.
- Run an automated scan: Use the Cookie Scanner to identify all cookies set before and after consent, and verify that non-essential cookies are properly gated.
- Check button prominence: Compare Accept and Reject buttons. Are they the same size, color, and click count? If Reject requires an extra step (e.g., “Manage Settings”), this may violate equal prominence requirements.
- GDPR compliance check: Run the GDPR Quick Check for a comprehensive assessment including consent banner behavior.
How to Build a Compliant Banner
Implementation Steps
- Block all non-essential scripts by default: Use
type="text/plain"or a tag manager's consent mode to prevent scripts from executing until consent is obtained. - Provide equal Accept and Reject buttons: Same size, same visual weight, same number of clicks. A “Reject All” button should be on the first screen, not behind a “Manage Settings” link.
- Categorize cookies: Group cookies into categories (Essential, Analytics, Marketing) with individual toggles. Essential cookies should be permanently enabled and clearly labeled.
- Explain purposes: Briefly describe what each category does and which services use the cookies in that category.
- Fire scripts dynamically on accept: When the user accepts, load analytics and ad scripts via JavaScript injection, never hardcode them in the HTML.
Script Gating Example
<!-- Before consent: script type prevents execution -->
<script type="text/plain" data-category="analytics"
src="https://analytics.example.com/script.js">
</script>
<!-- On accept: consent manager changes type to text/javascript -->
<!-- Script executes only after consent is given -->Best Practices
- Test consent in incognito mode, this simulates a first-time visitor with no existing consent cookie. Verify that no non-essential scripts fire.
- Make withdrawal easy, include a persistent way to change preferences (footer link or floating button). Withdrawing consent should be as easy as giving it.
- Re-prompt periodically, re-request consent every 6–12 months, or whenever you add new cookie categories or change vendors.
- Log consent records, store a record of when consent was given, what was accepted, and the version of your privacy policy at the time. This is your evidence in case of regulatory inquiry.
- Avoid dark patterns, no pre-ticked boxes, no asymmetric button styling, no guilt-tripping copy (“No thanks, I don't care about my experience”).
- Integrate with security headers, a strong CSP provides an additional technical enforcement layer that blocks unauthorized scripts even if your consent mechanism has a bug.
Common Mistakes (Dark Patterns)
| Dark Pattern | Why It's Non-Compliant | Fix |
|---|---|---|
| "Accept" is prominent, "Reject" is hidden | Consent not freely given, choice is manipulated | Equal button size and visual weight |
| "Reject" requires extra clicks (settings page) | Asymmetric effort makes rejection harder | Both options on first screen |
| Pre-ticked checkboxes | Consent is not affirmative if pre-selected | All non-essential categories default to OFF |
| Cookie wall (content blocked until accept) | Consent not freely given, user is coerced | Allow full access regardless of choice |
| "Accept by scrolling/browsing" | Not an unambiguous, affirmative action | Require explicit button click |
| No Reject option at all | Consent requires a genuine choice | Add clear Reject All button |
Most Banners Fail Here
<script src="analytics.js"> is hardcoded in the HTML, it executes immediately regardless of the banner.Conclusion
A compliant cookie consent banner is not just about displaying a popup, it is about ensuring that non-essential scripts genuinely do not execute until the user explicitly opts in. This requires technical implementation (script gating), design compliance (equal button prominence), and ongoing monitoring (regular audits).
With regulators actively scanning for violations and issuing significant fines, getting consent right is no longer optional. Start by testing your banner in incognito mode, audit your cookies, and ensure your rejection mechanism actually works.
Scan Your Website
Related Guides
Frequently Asked Questions
Can I use implied consent (scrolling or continuing to browse)?+
What is the difference between ePrivacy and GDPR consent?+
Is it legal to block website access until cookies are accepted?+
Do I need consent for Google Analytics?+
How should I handle consent for returning users?+
What is TCF 2.0?+
How long is consent valid?+
Audit Your Consent Banner
Verify whether your cookie consent banner actually blocks scripts, or if it's just a decorative popup.
For deeper runtime checks, run the full privacy audit →