GDPR Cookie Consent: How to Build a Compliant Banner

A cookie banner is often the first thing a data protection authority looks at on your website. It is visible, easy to test and easy to get wrong. This guide explains when you need consent, what a compliant banner must do, and how to build one that stands up in Germany and France. It is general information, not legal advice.

Two rules work together. The ePrivacy rules, implemented in national law, say you need consent before storing information on a visitor's device or reading it, with an exception for what is strictly necessary. In Germany this is section 25 of the TDDDG (the former TTDSG). In France it sits in the Data Protection Act and is enforced by the CNIL. The GDPR then sets the standard for what valid consent is, and where cookies involve personal data it applies in full.

In practice:

  • No consent needed: cookies strictly necessary to deliver a service the visitor asked for, such as a login session, shopping cart or load balancing.
  • Consent needed: advertising and retargeting pixels, most analytics tools, social media embeds, and embedded video or map services that set cookies or track visitors.

If you only use necessary cookies, you do not need a consent banner. You still need to tell visitors about them in your privacy notice.

Under the GDPR, consent must be freely given, specific, informed and unambiguous, and given by a clear affirmative action. For a banner this means:

  • No pre-ticked boxes. The Court of Justice of the EU confirmed in the Planet49 case that pre-ticked checkboxes are not valid consent.
  • Reject is as easy as accept. The CNIL has said repeatedly that refusing cookies must be as easy as accepting them, and it has issued orders and fines to sites that hid refusal behind extra clicks. The EDPB's cookie banner taskforce report (January 2023) reached a similar view on a missing reject option on the first layer. Put "Reject all" next to "Accept all", with equal size, colour and prominence.
  • Specific choices. Let people accept by purpose (analytics, marketing, and so on), not only all or nothing.
  • Plain information. Say who sets the cookies, what for, and link to your cookie and privacy policies.
  • Easy withdrawal. Withdrawing consent must be as simple as giving it, for example through a permanent "Cookie settings" link in the footer.
  • No cookie walls or nudging. Do not block the site until people accept, and avoid dark patterns such as a bright accept button against a faint grey reject link.

Build checklist

  1. Audit what your site sets. Load every key page in a clean browser profile, open the developer tools (Application tab) and list every cookie and tracker, including those set by third-party scripts.
  2. Classify each one as necessary, analytics, marketing or functional, and note the provider and purpose.
  3. Block before consent. Non-essential scripts must not load until the visitor opts in. A banner that only displays while trackers already fire is the most common failure.
  4. Design the first layer with "Accept all", "Reject all" and "Settings", all equally prominent.
  5. Add a settings layer with one toggle per purpose, all optional ones off by default.
  6. Store a consent record: what was chosen, when, and which banner version. You may need to prove consent later.
  7. Remember the choice so you do not ask on every page, and re-ask when your cookies or purposes change materially.
  8. Add a footer link to reopen the settings at any time.
  9. Update your privacy notice with a cookie list and retention periods.
  10. Test it. Reject everything, reload, and check the network tab: no analytics or advertising requests should fire.

Common mistakes

  • "By continuing to browse you agree." Scrolling or continuing is not a clear affirmative action.
  • Trackers firing before the choice. Tag managers and embedded widgets are frequent culprits.
  • Reject hidden on a second layer while accept is one click away.
  • Categories ticked by default.
  • Calling analytics "necessary" to avoid asking. Analytics help you, but the visitor did not request them.
  • Banner text in one language only for a multilingual audience. Offer the banner in the language of the page, such as German or French.

Why it matters

Cookie violations are among the most visible GDPR issues. French regulators have fined well-known publishers for placing cookies without consent, and German authorities publish guidance on telemedia and cookies and examine banners. Where the GDPR applies, the maximum fines are up to 20 million euros or 4% of worldwide annual turnover, whichever is higher, although penalties for a typical small business are far lower. Complaints from individuals, competitors or consumer groups are another route to trouble.

Germany and France in short

Design to the stricter reading and one banner will do for both markets. For more country detail, see our guides to GDPR in Germany (DSGVO) and GDPR in France (RGPD and the CNIL), and our GDPR compliance checklist for the wider picture.

Next steps

A banner is only as good as the website behind it. Scripts, third-party tools and tag managers must be controlled so nothing loads before consent, and the site itself must be secure. Our website security service can review what your site loads and how it is protected, and our security audit and compliance service helps with wider GDPR readiness. Dev Inventive works remotely with businesses in Europe, including Germany and France.

Frequently asked questions

Do I need a cookie banner if I only use necessary cookies?

Usually not. Cookies that are strictly necessary to deliver a service the visitor asked for, such as a shopping cart or login session, do not need consent. You should still describe them in your privacy notice. Analytics, advertising and most embedded third-party tools do need consent.

Does the reject button have to be on the first layer of the banner?

The French CNIL expects refusing to be as easy as accepting, so a reject option on the first layer is the safe design. The EDPB cookie banner taskforce report also treated a missing reject option on the first layer as a problem for valid consent. Building it that way avoids the debate.

Are pre-ticked boxes allowed for cookie consent?

No. The Court of Justice of the EU ruled in the Planet49 case that pre-ticked checkboxes do not give valid consent. Visitors must take a clear action, and optional categories must be off by default.

Does Germany have different cookie rules from France?

Both apply the same GDPR standard for consent, but the cookie rule itself comes from national law implementing the ePrivacy Directive: section 25 of the TDDDG in Germany and the Data Protection Act in France. Regulator guidance differs in detail, so a banner designed to the stricter reading works in both.

Have a project in mind?

Tell us what you want to build and we’ll get back to you with next steps.