Prompt

How do I set up a cookie consent banner that’s compliant in the EU and UK?

Technology / Marketing Automation1 observationLast seen Oct 29, 2026

Latest observation

Oct 29, 2026OpenAI APIWeb search: off

To set up a cookie consent banner that’s EU/UK-compliant, the key is to follow the rules under the ePrivacy rules + GDPR/UK GDPR:

Core requirements

You generally need:

  1. No non-essential cookies before consent

    • Analytics, advertising, retargeting, social media, and most tracking cookies must be blocked until the user opts in.
    • Only strictly necessary cookies can run immediately.
  2. Freely given, specific, informed, unambiguous consent

    • Consent must be an actual opt-in.
    • Pre-ticked boxes, “by continuing you agree,” or passive acceptance are not valid.
  3. Equal choice

    • “Accept all” and “Reject all” should be equally visible and easy to use on the first layer.
    • Avoid making rejection harder than acceptance.
  4. Granular controls

    • Let users choose by category, not just all-or-nothing, unless only one category exists.
    • Common categories: Necessary, Preferences, Analytics, Marketing.
  5. No tracking before consent

    • Load scripts only after the user consents, or use a tag manager/configuration that blocks them until consent is recorded.
    • This includes pixels, embedded videos, and third-party widgets that set cookies.
  6. Clear information

    • Explain what cookies are used for, who sets them, how long they last, and link to your cookie/privacy policy.
  7. Easy withdrawal

    • Users must be able to change or withdraw consent at any time, usually via a persistent “Cookie settings” link in the footer.
  8. Record consent

    • Keep a log of when and how consent was given, what the user chose, and the policy version shown.

A practical banner structure

First layer

Show:

  • Short explanation
  • Link to cookie policy
  • Buttons:
    • Accept all
    • Reject all
    • Cookie settings

Example text:

We use cookies to improve your experience, measure site traffic, and personalize content. You can accept all cookies, reject non-essential cookies, or manage your preferences. Read our Cookie Policy.

Second layer

Allow toggles for:

  • Necessary — always on
  • Preferences
  • Analytics
  • Marketing

Make sure:

  • Necessary is disabled/non-toggleable
  • Other categories are off by default
  • The user must actively turn them on and save

Technical implementation tips

1. Block scripts until consent

Use a consent management platform (CMP) or implement your own logic so tags don’t fire until consent is granted.

Example approach:

  • Store consent state in a cookie/local storage item
  • On page load, check the stored consent
  • If no consent, do not load non-essential scripts
  • If accepted, load the relevant tags

2. Make third-party embeds privacy-friendly

For:

  • YouTube
  • Vimeo
  • Google Maps
  • Social media embeds

Use:

  • Click-to-load placeholders, or
  • Privacy-enhanced embed modes where available

3. Separate consent by purpose

Don’t bundle analytics and marketing together unless you truly use them as one purpose.

4. Respect signals where applicable

If you operate in relevant jurisdictions and your stack supports it, consider integrating with frameworks like:

  • IAB TCF v2.2 for ad-tech ecosystems
  • Google Consent Mode v2 for Google tags

These don’t replace proper consent UX, but they can help ensure tags behave correctly.


Good vs bad examples

Good

  • Banner appears on first visit
  • User can reject as easily as accept
  • No analytics cookies set until opt-in
  • Clear categories and explanations
  • Persistent settings link

Bad

  • Cookies load before any choice
  • “By using this site, you agree”
  • Hidden rejection option
  • Default toggles set to on
  • Banner blocks the whole page until user clicks “Accept”

Important notes

  • The exact requirements can vary slightly between EU member states and UK interpretations, but the principles above are the safe baseline.
  • A small “strictly necessary only” site can sometimes avoid a complex banner if it truly uses no non-essential cookies.
  • This is a legal/compliance topic, so for a production site it’s wise to have a privacy lawyer review your implementation and cookie inventory.

Simple compliance checklist

  • Inventory all cookies and trackers
  • Block non-essential cookies before consent
  • Provide Accept all / Reject all / Settings
  • Default all non-essential categories to off
  • Give clear explanations
  • Log consent
  • Allow withdrawal anytime
  • Update policy and banner text when tools change

If you want, I can also give you:

  1. a sample compliant banner layout,
  2. example HTML/CSS/JS, or
  3. a checklist for specific tools like Google Analytics, Meta Pixel, and YouTube embeds.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.