Laws

Cookie Banner Requirements Under GDPR (With Examples)

The nine things a GDPR cookie banner needs: prior consent, a first-layer reject, no pre-ticked boxes, granular choices, easy withdrawal and records.

By the allowedit team · · 9 min read

The short answer

  • Under the GDPR and the ePrivacy rules, non-essential cookies need consent that is freely given, specific, informed and unambiguous, before they're set.
  • Regulators expect a reject option on the first layer that's as easy and as visible as accept, and no pre-ticked boxes.
  • Visitors must be able to withdraw consent as easily as they gave it, which in practice means a link or button to reopen the settings.
  • You must be able to show consent was given, so keep a record of each choice.

A GDPR-compliant cookie banner blocks every non-essential cookie until the visitor actively agrees, offers a reject option on the first layer that's as easy as accepting, lets people choose by category, and lets them change their mind later. It explains what each category does, never uses pre-ticked boxes, and you keep a record of each choice. Those rules come from the GDPR's definition of consent combined with the ePrivacy Directive, as read by the courts and the regulators.

Below are the nine requirements, where each one comes from, and what a good and a bad version look like.

Two laws work together:

  • The ePrivacy Directive, Article 5(3): storing or reading information on a user's device needs consent, unless it's strictly necessary for a service the user asked for. Each EU country has its own version in national law.
  • The GDPR: defines what valid consent is (Article 4(11) and Article 7) and covers the personal data the cookies collect.

Consent under the GDPR must be freely given, specific, informed and unambiguous, given by a clear affirmative action. Every requirement below follows from those words.

The European Data Protection Board (EDPB) published its consent guidelines (05/2020) and, in January 2023, a report from its Cookie Banner Taskforce. That report records where national regulators agree on common banner practices. It's the closest thing to a shared checklist.

The nine requirements

Analytics, advertising pixels, heatmaps and most embeds must not load until the visitor agrees. A banner that shows a message while Google Analytics and the Meta Pixel are already running doesn't meet the rule, however good it looks.

This is the most common failure in practice. The banner exists, but the scripts load anyway. Fixing it means blocking scripts until consent, either automatically or by marking them up.

2. A real choice on the first layer

Visitors must be able to refuse as easily as accept. The Taskforce report recorded that most regulators consider a banner without a reject (or equivalent) option on the first layer to be a breach. France's CNIL fined Google and Facebook a combined €210 million in January 2022 because refusing took several clicks while accepting took one.

Good: Accept all, Reject all and Customise side by side. Bad: Accept all, plus a small "Settings" link where reject is two screens deep.

We cover the details in the Reject all button rules.

3. No deceptive design

The Taskforce flagged several patterns as likely to mislead:

  • A reject option that's a plain text link next to a bold accept button.
  • Colours or contrast that make reject hard to see.
  • Claiming cookies are "essential" when they aren't.
  • Using "legitimate interest" for cookies that need consent.

Equal prominence doesn't mean identical buttons, but reject must be just as easy to see, read and click.

4. No pre-ticked boxes

In Planet49 (case C-673/17, October 2019), the EU's Court of Justice ruled that a pre-ticked checkbox isn't valid consent, and that the rule applies to cookies whether or not the data is personal. Every optional category must start switched off.

5. Specific choices by purpose

Consent must be specific. Visitors should be able to accept analytics but refuse marketing. The usual structure is four categories:

CategoryExamplesNeeds consent?
NecessaryLogin session, cart, security, the consent cookieNo
PreferencesLanguage, region, saved settingsUsually
AnalyticsGoogle Analytics, Matomo (standard setup), ClarityYes
MarketingMeta Pixel, Google Ads, TikTok, LinkedIn, YouTube embedsYes

6. Clear information

Informed consent means people know what they're agreeing to. The banner should say, in plain words, what you use cookies for. The preferences panel should describe each category, and your site should have a cookie declaration listing each cookie, who sets it, its purpose and its duration.

Keep the first layer short. A long paragraph of legal text isn't more informed, it's less read.

Scrolling, clicking elsewhere or closing the banner doesn't count. Consent has to be a clear affirmative action, like pressing Accept. The EDPB's consent guidelines say this directly.

That also means a banner that disappears on scroll and treats it as acceptance is a breach.

8. Easy withdrawal

Article 7(3) of the GDPR says withdrawing consent must be as easy as giving it. In practice, that means a persistent way to reopen the preferences: a small floating button, or a "Cookie settings" link in the footer that works on every page. When someone withdraws, the trackers should stop on the next page view.

Article 7(1) says the controller must be able to demonstrate consent. Keep a record of each choice: when it was made, what was chosen and which version of the banner the visitor saw. That record should avoid storing more personal data than it needs. Our post on proof of consent explains what to keep.

What do national regulators add?

The core is the same everywhere, but each country's regulator has its own guidance. A few well-known points:

  • France (CNIL): reject must be as easy as accept; it recommends keeping a choice (including a refusal) for about six months before asking again.
  • Germany (TDDDG, formerly TTDSG): the German version of Article 5(3), applied strictly. German courts have also ruled against banners that nudge toward accepting.
  • UK (ICO, under PECR): the same consent standard; the ICO has written to many large sites about missing reject buttons.
  • Ireland, Netherlands, Italy, Spain: all publish cookie guidance aligned with the EDPB's, with minor differences in wording.

If you serve one main market, read your own regulator's page once. It's usually shorter than you expect.

Standard Google Analytics needs consent in the EU. Google also requires Consent Mode v2 signals from EEA traffic before it uses that data for ad personalisation, so the banner has to tell Google's tags what was chosen. Consent Mode is Google's rule, not the GDPR, but you'll want both.

What does a compliant banner look like?

A short example of first-layer text:

We use cookies to run this site and, if you agree, to measure visits and show relevant ads. You can accept all, reject all, or choose. You can change your mind any time in Cookie settings.

Then three equal buttons: Accept all, Reject all, Customise. Customise opens a panel with the four categories, each with a switch (necessary is always on and can't be turned off), a description, and the list of cookies in it.

How allowedit covers each requirement

RequirementHow allowedit handles it
Nothing before consentAuto-blocking of 40+ known trackers, plus manual data-category scripts and your own URL rules
Reject on the first layerReject all shown by default, with the same style as Accept
No pre-ticked boxesEvery optional category starts off
Specific choicesNecessary, preferences, analytics and marketing
Clear informationEditable text in 7 languages, and a cookie declaration that updates after each scan
WithdrawalA floating Cookie settings button, and links with href="#cookie-settings"
ProofA consent log with a random consent id, timestamp, choices, banner version and region, and no IP address

The region rules apply opt-in to the EU and EEA, the UK, Switzerland and Quebec automatically, so visitors elsewhere can get the lighter treatment their law allows.

What allowedit doesn't do: it doesn't support the IAB Transparency and Consent Framework yet, so if you sell ads through programmatic exchanges that need a TCF string, you'll need a TCF-registered tool. And while the default wording is written to meet the rules above, it's yours to review with your own lawyer. We're not a law firm.

A five-minute self-check

Open your site in a private window and check:

  1. Does the banner appear before anything else happens?
  2. Is there a Reject all button on the first screen, as visible as Accept?
  3. Click Reject all. Do analytics and marketing requests stop? (Check the Network tab, or run the free cookie checker.)
  4. Can you reopen the settings from every page?
  5. Are all optional switches off when you open Customise?

If any answer is no, that's the thing to fix first. The full legal background is on our GDPR cookie consent page.

Frequently asked questions

Is the GDPR or the ePrivacy Directive the cookie law?

Both. The ePrivacy Directive (Article 5(3)) says you need consent to store or read non-essential information on a device. The GDPR defines what valid consent is and applies to the personal data the cookies collect.

Can I use a cookie wall that blocks the site until people accept?

Generally not. Most EU regulators, and the EDPB's guidelines on consent, say making access depend on accepting cookies means consent isn't freely given. A few regulators allow narrow exceptions, such as a paid alternative, but that's a legal question for your own adviser.

How long does consent last?

The GDPR doesn't set a period. Many regulators suggest asking again after a reasonable time; the CNIL recommends keeping a choice for around six months. Many sites use 6 to 12 months. allowedit lets you set it between 30 and 395 days.

Do I need to list every cookie?

You need to tell visitors what you use and why, with enough detail for them to decide. In practice that means a cookie declaration listing each cookie, who sets it, its purpose and how long it lasts, usually on your privacy page.

Does the UK follow the same rules?

Largely, yes. The UK GDPR and the Privacy and Electronic Communications Regulations (PECR) work the same way for cookies, and the ICO expects a reject option that's as easy as accept.