Cookie Consent Banner Compliance

How to implement a cookie consent banner that is legally compliant, user-friendly, and actually works.

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.

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.

Check if your consent banner is actually blocking scripts.

Run Cookie Consent Check

Real-World Enforcement

OrganizationFineViolation
Google (France)€150MReject option required more clicks than Accept
Amazon (France)€35MCookies dropped before consent was given
Criteo€40MCross-site tracking without valid opt-in
TikTok (France)€5MReject option not equally prominent
Microsoft (France)€60MNon-essential cookies placed without consent

Pattern: Equal Button Prominence

The most common violation pattern is making “Reject” harder than “Accept.” EU regulators have specifically stated that both options must have equal visual weight, same button size, same click count, same visual prominence.

How to Detect Non-Compliance

  1. 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.
  2. Test rejection: Click “Reject All” and check whether analytics/ad cookies still appear. If they do, your rejection mechanism is broken.
  3. 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.
  4. 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.
  5. GDPR compliance check: Run the GDPR Quick Check for a comprehensive assessment including consent banner behavior.

How to Build a Compliant Banner

Implementation Steps

  1. 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.
  2. 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.
  3. Categorize cookies: Group cookies into categories (Essential, Analytics, Marketing) with individual toggles. Essential cookies should be permanently enabled and clearly labeled.
  4. Explain purposes: Briefly describe what each category does and which services use the cookies in that category.
  5. 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 -->
Many CMP (Consent Management Platform) tools handle this automatically. Popular options include Cookiebot, OneTrust, and Termly. Choose one that supports TCF 2.0 if you work with advertising partners.

Best Practices

  1. Test consent in incognito mode, this simulates a first-time visitor with no existing consent cookie. Verify that no non-essential scripts fire.
  2. Make withdrawal easy, include a persistent way to change preferences (footer link or floating button). Withdrawing consent should be as easy as giving it.
  3. Re-prompt periodically, re-request consent every 6–12 months, or whenever you add new cookie categories or change vendors.
  4. 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.
  5. Avoid dark patterns, no pre-ticked boxes, no asymmetric button styling, no guilt-tripping copy (“No thanks, I don't care about my experience”).
  6. 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 PatternWhy It's Non-CompliantFix
"Accept" is prominent, "Reject" is hiddenConsent not freely given, choice is manipulatedEqual button size and visual weight
"Reject" requires extra clicks (settings page)Asymmetric effort makes rejection harderBoth options on first screen
Pre-ticked checkboxesConsent is not affirmative if pre-selectedAll non-essential categories default to OFF
Cookie wall (content blocked until accept)Consent not freely given, user is coercedAllow full access regardless of choice
"Accept by scrolling/browsing"Not an unambiguous, affirmative actionRequire explicit button click
No Reject option at allConsent requires a genuine choiceAdd clear Reject All button

Most Banners Fail Here

The most common violation is not the banner design, it is that non-essential scripts fire before consent is given. Your banner might look perfect, but if <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

Scan your website with SitePrivacyScore to detect cookie consent issues automatically. Our free scanner checks whether scripts fire before consent, identifies non-essential cookies, and evaluates your banner behavior.

Related Guides

Frequently Asked Questions

Can I use implied consent (scrolling or continuing to browse)?+
No. EU courts and regulators have ruled that implied consent (e.g., 'by continuing to browse you agree') is not valid. Consent must be a clear and affirmative action, such as clicking an opt-in button.
What is the difference between ePrivacy and GDPR consent?+
The ePrivacy Directive specifically governs storing data on a user's device (cookies). GDPR governs broader personal data processing. Both require explicit, informed, freely given consent.
Is it legal to block website access until cookies are accepted?+
No. This is called a 'cookie wall' and has been explicitly banned by EU regulators. Users must be able to access your content regardless of their cookie preferences.
Do I need consent for Google Analytics?+
Yes. Google Analytics sets non-essential cookies and transfers data to Google's servers. This requires explicit consent under both the ePrivacy Directive and GDPR.
How should I handle consent for returning users?+
Store the user's consent preference in a cookie itself. On subsequent visits, respect their previous choice without re-prompting, unless your cookie categories or third-party vendors have changed.
What is TCF 2.0?+
The IAB Transparency and Consent Framework is a standardized consent management spec used by ad tech. It allows consent preferences to be shared with ad vendors, but has faced legal challenges over whether it constitutes valid GDPR consent.
How long is consent valid?+
Most regulators recommend re-prompting after 6-12 months. Always re-prompt if you add new cookie categories or change third-party vendors.

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 →