Cookie Banner Rules 2026: Google Analytics, Meta Pixel and YouTube in the EU, Germany and the UK
When does your website need cookie consent, and what must the banner look like? The rule in the EU, Germany and the UK, what courts and regulators require of the banner, and what it means for Google Analytics, Meta Pixel and YouTube embeds.
Also available in: DeutschУкраїнська
Almost every website owner has met the question: do I need a cookie banner, and is mine good enough? The answers you find online are often a mix of law, myths and vendor marketing. This article goes back to the words of the law: the rule itself in the EU, Germany and the UK, what courts and regulators have said about how a banner must look, and what that means for the scripts most websites actually load: Google Analytics, the Meta Pixel and embedded YouTube videos.
Every rule we quote links to legalgraph.org, our open knowledge graph of website law. There you can read each provision in its original language and in English, side by side, and see which other rules it is connected to.
Researchers, not lawyers. Aimix studies how website rules are written and applied. This article is a well-sourced orientation, not legal advice. For decisions that matter, ask a lawyer admitted in your country.
The rule: consent before anything is stored on or read from the device
The cookie rule in Europe is not in the GDPRGeneral Data Protection Regulation, (EU) 2016/679 (German: DSGVO)The EU's data protection law. It governs how websites collect and use personal data, for example through forms and analytics.. It is in the older ePrivacy Directive, Article 5(3), which every EU country has written into its own law. It says that storing information on a user's device, or reading information already stored there, is allowed only if the user has consented after clear and comprehensive information, in particular about the purposes.
There are only two exceptions:
- storage or access whose sole purpose is to carry a communication over a network, and
- storage or access that is strictly necessary to provide a service the user explicitly requested.
Two details of this rule surprise many people:
- It is not only about cookies. The rule covers any information on the "terminal equipment": cookies, local storage, tracking pixels, scripts that read device properties. The European Data Protection Board (EDPBEuropean Data Protection Board (German: EDSA)The EU body of all national data protection authorities. Its guidelines explain how the GDPR and the cookie rules are applied.) explains in its Guidelines 2/2023 that a tracking pixel or tracking link counts too: it instructs the browser to send back an identifier, and that is "gaining access" to information on the device. Even storage in the browser cache counts, however briefly.
- It is not only about personal data. The rule protects the device itself. Whether the cookie contains personal data does not matter for the question of consent; it matters only for what comes next, under the GDPR.
Germany: § 25 TDDDG
In Germany, the rule is § 25 of the TDDDGTelekommunikation-Digitale-Dienste-Datenschutz-Gesetz (formerly TTDSG)German law on cookies and device access: storing or reading information on a device needs consent unless strictly necessary. (until May 2024 called TTDSG). It follows the directive closely: consent based on clear and comprehensive information, given as the GDPR defines consent, with the same two exceptions. The law applies to anyone who provides services in Germany, even without an establishment there. Breaches can be fined up to €300,000, and competitors and consumer associations can send an AbmahnungFormal warning letter (German competition law)A formal warning, often from a competitor's lawyer, demanding that you stop a legal violation. for them.
Other EU countries: same rule, national words
Because the rule comes from a directive, each country has its own wording. In the graph, you can see them side by side with the directive they implement:
| Country | Provision | Notable wording |
|---|---|---|
| Austria | § 165(3) Telecommunications Act 2021 | consent must be given "actively"; users must also be told how long data is stored |
| Spain | Art. 22.2 Ley 34/2002 | "clear and complete information" about the use, in particular the purposes |
| Italy | Art. 122 Codice privacy | information by "simplified means", which the data protection authority defines |
| Ireland | Reg. 5(3) S.I. No. 336/2011 | information must be "prominently displayed and easily accessible" |
The core is the same everywhere: no consent, no non-essential cookies.
The UK: consent, with new exceptions since February 2026
The UK kept the rule after Brexit in regulation 6 of the Privacy and Electronic Communications Regulations (PECRPrivacy and Electronic Communications Regulations 2003 (UK)The UK rules on cookies, similar technologies and electronic marketing. They apply alongside the UK GDPR.). Since 5 February 2026, the Data (Use and Access) Act 2025 has reorganised it: storage or access is prohibited unless an exception in a new Schedule A1 applies. Consent is one of them, strict necessity another. Two are new, and they matter for many websites:
- Analytics to improve your site (paragraph 5): you may collect statistics about how your service or website is used, to improve it, without consent, if the information is not shared with anyone except to help you make those improvements, you tell users clearly, and you give them a simple, free way to object.
- Appearance and functionality (paragraph 6): storing a user's preferences, such as language or a dark theme, or otherwise enhancing how the site looks or works, on the same conditions.
So for a UK audience, privacy-friendly first-party analytics can run with an opt-out instead of an opt-in. Advertising and cross-site tracking still need consent. The EU has no such exception: for EU visitors, analytics cookies still need consent.
"Strictly necessary" is narrow
Most banners have a "necessary" category that cannot be switched off. What belongs there? The German data protection authorities (the DSKDatenschutzkonferenz, the conference of German data protection authoritiesThe joint body of Germany's federal and state data protection authorities. Its guidance shows how they apply the GDPR and the TDDDG.) answer in their guidance on digital services: only what is technically necessary to provide exactly the service the user asked for. That something is economically necessary for your business model does not count.
In practice, these usually qualify: a session cookie that keeps a shopping cart or a login, a load-balancing cookie, a security token against form abuse, and the cookie that stores the user's consent choice itself. Analytics, advertising, A/B tests and social media pixels usually do not.
What a valid banner must look like
The law says "consent". Courts and regulators have filled in what that means for a banner. Here are the points they agree on, with the source for each:
No pre-ticked boxes
Consent given by not unticking a checkbox is no consent. The Court of Justice decided this in Planet49 (C-673/17).
Scrolling or doing nothing is not consent
Scrolling, swiping or continuing to browse can never be a clear affirmative action (EDPB Guidelines 05/2020, para. 86). The French authority adds: any inaction counts as refusal, so nothing that needs consent may run (CNIL recommendation, para. 9).
Refusing must be as easy as accepting
If the first layer has an 'Accept all' button, it needs an equally visible way to refuse. A refusal hidden on a second layer makes consent involuntary (DSK guidance, para. 58; Higher Regional Court of Cologne, 6 U 80/23). The French authority suggests two buttons of the same level and format, such as 'Accept all' and 'Refuse all'.
Purposes on the first layer
If users can consent on the first layer, the specific purposes must be named there too. 'We use cookies to offer you a better experience' is too vague (DSK guidance, para. 53).
Duration and third parties
The information must include how long cookies operate and whether third parties can access them (Planet49, ruling 3).
No cookie walls
Making access to the site depend on accepting cookies prevents consent from being freely given (EDPB Guidelines 05/2020, para. 39). Paid alternatives ('pay or okay') are judged case by case.
No tricks with the close button
An 'X' that silently means 'accept' is not valid consent. Users know the X as a way to close a window (Higher Regional Court of Cologne, 6 U 80/23, para. 54).
Withdrawing as easy as giving
Users must be able to change their mind at any time, as easily as they consented (Article 7(3) GDPR). A permanent 'Cookie settings' link in the footer is the usual solution.
Keep proof, and treat it as personal data
You must be able to show that a user consented (Article 7(1) GDPR). The record of a user's choices is itself personal data when it can be linked to the user, for example through the IP address (IAB Europe, C-604/22).
You can read each source in the graph: Planet49 and its ruling on duration and third parties, IAB Europe, the EDPB on scrolling and cookie walls, the French authority (CNILCommission nationale de l'informatique et des libertés, the French data protection authorityFrance's data protection authority. Its cookie guidelines and large fines have shaped how consent banners look across Europe.) on inaction and two equal buttons, the DSK on refusal effort and purposes on the first layer, the Cologne court on the missing reject button and the "Accept & close X", and Article 7(1) and 7(3) GDPR.
These are not theoretical: in decisions of 31 December 2021, the CNIL fined Google €150 million and Facebook €60 million because refusing cookies on their sites took several clicks while accepting took one.
Google Analytics, Meta Pixel, YouTube: what the cookie rules mean in practice
Google Analytics
Google Analytics sets cookies and reads them on every visit to recognise returning users. That is storage and access that is not strictly necessary, so in the EU and in Germany, it needs consent before it loads. Load the script only after the user has accepted the analytics category.
Two further points:
- Consent Mode. Google's Consent Mode has a "basic" setup, where the tags do not load until consent, and an "advanced" one, where they load anyway and send cookieless signals before consent. Those signals are still requests the page instructs the browser to send. Read with the EDPB's Guidelines 2/2023, we would treat them as needing consent in the EU, and use the basic setup.
- Transfers to the US. Analytics data goes to Google in the United States. That is lawful through the EU–US Data Privacy Framework, for which the Commission adopted an adequacy decision in 2023, as long as the recipient is certified. Name the transfer and its basis in your privacy policy.
For UK visitors, the new analytics exception can apply, but only on its conditions: statistics to improve your own site, no sharing for other purposes (so no advertising features or data sharing with the provider for its own use), clear information and a free way to object. A privacy-friendly analytics tool that keeps the data to itself fits more easily.
Meta Pixel (and other advertising pixels)
The Meta Pixel loads a script, sets a first-party cookie and sends events about what visitors do to Meta. It needs consent in the EU, Germany and the UK: advertising is none of the exceptions.
There is a second consequence that site owners often miss. The Court of Justice decided in Fashion ID (C-40/17) that a website that embeds a Facebook plugin is a joint controller with Facebook for collecting and transmitting the visitors' data. For joint controllers, Article 26 GDPR requires an arrangement that sets out who does what; Meta provides one as an addendum to its business terms. Mention the pixel, Meta as recipient and the joint controllership in your privacy policy.
YouTube and other embeds
An embedded YouTube video loads content from Google's servers as soon as the page opens, before anyone presses play, and Google can set and read identifiers. The "privacy-enhanced mode" (youtube-nocookie.com) reduces this but does not stop the request to Google.
The safest pattern is click to load: show a preview image with a short note ("This video is hosted by YouTube. Loading it sends data to Google.") and load the player only when the user clicks. The same applies to maps, social media feeds and chat widgets.
Fonts and other files from third-party servers
Not cookies, but closely related: loading Google Fonts from Google's servers sends every visitor's IP address to Google. In January 2022, the Regional Court of Munich (3 O 17493/20) awarded a visitor €100 in damages for this under Article 82 GDPR, and a wave of warning letters followed. The fix is easy: host fonts and scripts on your own server.
A quick self-check
- List every script, pixel, embed and font your site loads, and where it loads from.
- Sort them: strictly necessary for what the user asked for, or not?
- Nothing that is not strictly necessary loads before consent (check the network tab of your browser on a fresh visit).
- The first layer of the banner names the purposes and has "Accept all" and "Refuse all" (or equivalent) of the same weight.
- No pre-ticked boxes, no consent by scrolling, no "X" that means "accept".
- The banner or the cookie policy says how long each cookie lasts and which third parties get access.
- A "Cookie settings" link is available on every page, so users can withdraw consent.
- Videos, maps and social media embeds load only after a click.
- Fonts are self-hosted.
- The privacy policy names each tool, its purpose, its legal basis and any transfer outside the EU.
- For UK visitors: if you rely on the new analytics exception, you tell users and offer a free opt-out.
A banner is not always needed
The best banner is the one you do not need. A site that uses only strictly necessary storage needs no consent at all. legalgraph.org itself is an example: it has no cookies, no analytics and no third-party scripts, and stores only the display settings a visitor chooses, in the visitor's own browser. Its privacy policy explains this in a few paragraphs.
If you want to check which rules apply to your website, the checklist on legalgraph.org asks a few questions about your business and lists the rules in the graph that match, including the cookie rules for the EU, Germany, Austria and the UK, each linked to the provision it comes from.
This article provides general information about cookie and consent rules and does not constitute legal advice. For your specific situation, consult a qualified lawyer.