# Do I need a cookie banner? What needs consent

> Which cookies and scripts need a cookie banner in the EU, which are exempt, what the banner must offer, and what may load before a visitor answers.

Published 2026-11-26 · https://aiskills402.com/blog/do-i-need-a-cookie-banner

A cookie banner is needed when your site stores something on a visitor's device, or reads something already there, for any purpose the visitor did not directly ask for. A cookie the requested service cannot run without is exempt, and so is storage whose sole job is to carry a message across a network. Everything else, such as advertising, tracking and most analytics, waits for a yes. The rule covers scripts as well as cookies, so a tag that has the browser pass information to a server can need the same consent. This guide separates the two groups, lists what a valid cookie consent banner must offer, and says what may load before anyone clicks. It reads published texts and gives no legal advice.

## The test behind every cookie banner

The rule is Article 5(3) of Directive 2002/58, the ePrivacy Directive. Storing information on a device, or gaining access to information already stored there, is allowed only with the person's consent, after clear information about the purposes. The text says "information", not personal data, and it has two exceptions: technical storage whose only job is to transmit a communication, and storage strictly needed so that a requested service, one the person explicitly asked for, can be provided ([Directive 2002/58, Article 5(3)](https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:02002L0058-20091219)).

Two consequences follow. First, the question is never "is it a cookie?" but "does this store or read something on the device, and is it one of the two exceptions?". Second, the exceptions are narrow and are read per purpose, so one cookie can be exempt while another set by the same site is not. The EDPB, the body of European data protection regulators, states plainly that being covered by the article does not always mean consent is needed, and that each case must be checked against the exceptions. It also leaves the detail of the exceptions to national law and national regulators ([the EDPB's technical guidelines](https://www.edpb.europa.eu/system/files/documents/2024-10/edpb_guidelines_202302_technical_scope_art_53_eprivacydirective_v2_en_0.pdf), paragraphs 4 and 56).

## Strictly necessary cookies: what really qualifies

The word to hold on to is "requested". A visitor logs in, fills a basket or opens a page; the cookie that keeps that working belongs to a service they asked for. In practice this covers a login session, a shopping basket, a form's anti-forgery token and the routing cookie of a load balancer. The cookie that remembers the visitor's own answer to the banner is on the same side of the line, and the Taskforce report recalls an older European opinion saying that cookies holding preferences the user chose for a service count as essential ([Taskforce report, paragraph 30](https://www.edpb.europa.eu/system/files/documents/2023-01/edpb_20230118_report_cookie_banner_taskforce_en.pdf)).

The mistake runs the other way. Regulators observed that some site owners file cookies under "essential" although the cookies serve other purposes, which fails the strict reading ([Taskforce report](https://www.edpb.europa.eu/system/files/documents/2023-01/edpb_20230118_report_cookie_banner_taskforce_en.pdf), paragraphs 26 and 27). A cookie is not necessary because the site would be worse without it, or because the owner needs it. It is necessary only if the visitor's requested service cannot be delivered without it. A visitor counter, an advertising identifier, a heat-map recorder and an "A/B variant" cookie fail that test as ordinary tools.

Analytics sits in the middle and deserves its own warning. The EU-wide text contains no analytics exception, and France allows audience measurement without consent only under listed conditions, adding that most large measurement products do not fit them whatever the settings ([CNIL sheet 16](https://www.cnil.fr/en/sheet-ndeg16-use-analytics-your-websites-and-applications)). We examined that disagreement in a separate report on [whether analytics without cookies needs consent](/blog/cookieless-analytics-eu-consent), so it is left there.

Attributes such as Secure or HttpOnly do not change the category. They say how well a cookie is protected, not whether it may exist, a separate matter we covered in a guide to [what each cookie attribute really guards against](/blog/cookie-attributes-mistakes).

## Scripts and embeds count too

The EDPB reads "gaining access" widely. When an entity sends instructions so that the browser returns information, article 5(3) applies; a script that collects identifiers is that instruction, and the article still applies to information produced locally once the code forwards it to a server ([EDPB technical guidelines](https://www.edpb.europa.eu/system/files/documents/2024-10/edpb_guidelines_202302_technical_scope_art_53_eprivacydirective_v2_en_0.pdf), paragraphs 32, 51 and 53). Tracking pixels fall in too, since delivering them to the browser is storage at least through its cache, even if nothing is kept permanently.

So the list that needs a yes is wider than "cookies": advertising and remarketing tags, social-media pixels, session recorders, and video or map embeds that contact their provider and set cookies on load. A tag manager is only a container; what it loads decides.

## What a cookie consent banner must offer

A banner has to produce a valid consent. Several points below come from one document, the Taskforce report of European regulators; it records a shared minimum, not a clearance, and leaves the national rules in full force.

- **A way to refuse, as easy to find as the accept button.** The taskforce records that a vast majority of regulators treat a banner with no refuse option on any layer that carries a consent button as an infringement, while a few did not agree because the Directive does not mention a reject button ([Taskforce, paragraph 8](https://www.edpb.europa.eu/system/files/documents/2023-01/edpb_20230118_report_cookie_banner_taskforce_en.pdf)). Plan for the majority view.
- **No pre-ticked boxes.** The Court of Justice ruled that a pre-checked checkbox the user must untick does not produce valid consent, and regulators confirm it in their report ([Planet49, C-673/17](https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CELEX:62017CJ0673); Taskforce paragraph 10). The EDPB's consent guidelines add that carrying on using a website is not consent either.
- **No pressure.** The banner must not suggest that you need to agree to see the content or push towards agreeing. A "continue without accepting" link buried in a paragraph, or placed outside the banner with little visual support, is named as not valid ([Taskforce, paragraphs 13 and 14](https://www.edpb.europa.eu/system/files/documents/2023-01/edpb_20230118_report_cookie_banner_taskforce_en.pdf)).
- **Choice per purpose.** Visitors should pick which purposes to allow rather than accept a bundle.
- **Plain information.** The Court says the information given includes how long cookies last and whether third parties can access them (Planet49).
- **An easy way back.** Withdrawal must be easy to find at any time, for example a visible link or a small permanent icon; no particular design is imposed ([Taskforce, paragraphs 32 to 35](https://www.edpb.europa.eu/system/files/documents/2023-01/edpb_20230118_report_cookie_banner_taskforce_en.pdf)).
- **A basis other than legitimate interest.** Regulators state that legitimate interest cannot justify setting or reading a cookie under this article ([Taskforce, paragraph 24](https://www.edpb.europa.eu/system/files/documents/2023-01/edpb_20230118_report_cookie_banner_taskforce_en.pdf)).

Colours and contrast are judged case by case; no general standard exists, but a button whose text is unreadable is called misleading ([Taskforce, paragraphs 17 and 18](https://www.edpb.europa.eu/system/files/documents/2023-01/edpb_20230118_report_cookie_banner_taskforce_en.pdf)).

## What may load before the visitor answers

Only what falls under the exceptions. Before a choice, the page may set the session or basket cookie of a service the visitor has asked for, and it may store the choice itself. A tracker, a pixel or an embed that sets cookies on load must wait, and so must any script of the kinds listed above. If the visitor refuses, they stay off, and the refusal should be remembered so the banner does not ask again on every page.

The classic failure is order. The banner appears correctly, but the tags sit in the HTML head and start before any script of the banner has run, so the question is asked after the answer was taken. Another is a "nocookie" embed treated as exempt: the address says no cookie, which tells you nothing about other storage or requests.

## A check that can fail

The settings screen proves nothing here; observe what the browser actually did.

1. Open the site in a clean browser profile, with no extensions, and click nothing.
2. Wait a few seconds, then list the cookies, the local and session storage entries and the hosts contacted, from the developer tools.
3. Write down each item, name its purpose, and mark whether it fits one of the two exceptions. Whatever is left is what the banner has to hold back.
4. Click the refuse button and repeat. The list must be no longer than before, and a reload must not bring the question back.
5. Make the check capable of failing: add a known third-party tracker above the banner script on a staging copy and run steps 1 and 2 again. If the check does not show the new tracker, it is not looking at the right thing.

If you also keep an analytics dashboard, remember that a banner changes who gets counted, and that is a measurement matter, not a legal one.

## When this does not apply

Take none of this as legal advice. It is a reading of published European texts, and no lawyer or regulator has read it. Article 5(3) is a directive, so each member state wrote its own version, and the exceptions, in particular for analytics, differ by country; we checked only the EU texts and the French sheet, and did not check the regulator of Bulgaria or most other states. The Taskforce report is a common minimum of regulators, not a ruling, and the French sheet dates from June 2020. We compared the quoted Article 5(3) and the Planet49 ruling with the live EUR-Lex pages on 26 November 2026. A site with no visitors from the EU, or one that stores nothing on the device, has a different question. If a decision matters, a lawyer who knows your country should read your actual setup.

## Our skills for this topic

- [Cookie consent setup review](/skills/gdpr-cookie-consent-review) takes a pasted snapshot of your consent setup, together with what a clean browser stored before any click, and reports each problem with the named authority behind it and whether that is law, guidance or a vendor: early trackers, a missing refuse option, analytics filed as necessary.
- [Cookie Attributes Review](/skills/cookie-attributes-review) examines Set-Cookie lines, or the source that writes them, and flags the attribute slips that endanger a login session.
- [Real readers versus bots](/skills/traffic-reality-check) helps after the banner is live: it separates real readers from bots and your own checks in Cloudflare analytics, and points to settings that cause a false zero, such as excluding EU visitors.
- [GA4 Tracking Plan Limits](/skills/ga4-tracking-plan-limits) checks a Google Analytics 4 plan for names, counts and dimensions that break the published limits; it does not decide what needs consent.
