Code BLACKGO: cookie banner free for a year. Create an account →

Publications / Law and cookies

Cookie banner – the complete guide

When a website needs consent to cookies, what the banner must allow, which categories require consent and how to block scripts until the visitor decides.

Author: Carol.B Published: 13 min read

Cookie banner – the complete guide

A cookie banner is the window in which the visitor decides whether the website may store cookies in their browser and run the tools that use them: statistics, advertising pixels, embedded videos or maps. Below we describe when consent is needed, what the banner must allow and how to stop scripts until the visitor decides. This text summarises the law and does not replace legal advice.

The basis is Article 5(3) of Directive 2002/58/EC, known as the ePrivacy Directive. Storing information on the user's device, or gaining access to information already stored there, is allowed only if the user has given consent after receiving clear and comprehensive information, among other things about the purposes. The directive does not apply directly – each Member State has transposed it into its own law, for example § 25 TDDDG in Germany or Article 82 of the Informatique et Libertés Act in France. We have collected the provisions of individual countries on the National laws page.

Consent is not needed in two cases: where the storage or access serves solely to transmit a communication over a network, or where it is strictly necessary to provide a service explicitly requested by the user. Examples are a shopping cart, a login session, security measures and remembering the choice made in the banner.

Three things that are easy to forget:

  • The provision covers all information stored on the device, including information that is not personal data. The Court of Justice of the EU confirmed this in the Planet49 judgment (C-673/17). It therefore also covers statistics that do not directly identify a person.
  • According to EDPB Guidelines 2/2023, the provision covers not only cookies but also tracking pixels, links with identifiers, local storage and browser fingerprinting.
  • A third-party plugin embedded on the site can transmit data as soon as the visitor arrives. In the Fashion ID judgment (C-40/17) the CJEU held that the owner of a website with a “Like” button is a joint controller of that data and is responsible for obtaining consent.

If the website runs Google Analytics, the Meta pixel, a Google Ads tag, an embedded YouTube video or a Google map, it uses services that are not necessary to display it – and it needs consent for them. More about the provision itself: ePrivacy Directive.

The ePrivacy Directive uses the definition of consent from the GDPR (Regulation 2016/679). Under Article 4(11) GDPR, consent is a freely given, specific, informed and unambiguous indication of wishes – by a statement or by a clear affirmative action. The GDPR and the EDPB guidelines set specific requirements for the banner:

  • silence, inactivity and pre-ticked boxes are not consent (GDPR Recital 32, Planet49 judgment),
  • scrolling the page is not consent either (EDPB Guidelines 05/2020 on consent),
  • consent is not freely given if access to a service that does not require it depends on it (Article 7(4) GDPR); according to the EDPB, a “cookie wall” – content available only after acceptance – does not result in freely given consent,
  • consent can be withdrawn at any time, and withdrawing it must be as easy as giving it (Article 7(3) GDPR),
  • the website owner must be able to demonstrate that consent was obtained (Article 7(1) GDPR).

Where cookies are used to process personal data – and analytics and advertising tools usually do this – the other GDPR rules also apply, including the duty to inform under Article 13. Details: GDPR – what consent is valid.

What the banner must allow

Accept and reject on the same level

Rejecting must be as easy as accepting. In its report of 17 January 2023, the EDPB Cookie Banner Taskforce listed a missing reject button on the first layer of the banner and misleading button colours and contrasts among the infringements that authorities challenge most often. In practice, “Reject all” sits next to “Accept all”, is the same size and looks similar. In January 2022 the French authority CNIL fined Google and Facebook precisely because rejecting was harder than accepting – examples of decisions are on the Fines page.

Choice of categories

Consent must be specific, so the visitor should be able to agree to statistics, for example, and refuse advertising. This is usually done in the second layer of the banner: a settings window with a switch for each category and a button to save the choice.

No pre-ticked boxes

Switches for categories that require consent must be off at the start. Only the necessary category is permanently on. A box ticked on the visitor's behalf is not consent – the CJEU ruled this in Planet49, and in Orange Romania (C-61/19) it added that a box ticked by the seller does not prove the customer's consent.

Information about services

The visitor must know who collects the data, for what purpose and how long the cookies remain active. According to the Planet49 judgment, they should also know whether third parties have access to the cookies. The banner itself can say this briefly, while the list of services – with the provider, purpose, cookie duration and information on data transfers outside the EEA – should be one click away and consistent with the privacy policy.

Since withdrawing must be as easy as consenting, the visitor needs permanent access to the settings: an icon in the corner of the page or a “Cookie settings” link in the footer. After withdrawal, scripts from the disabled category should stop running. In the consetgo module every change to the saved decision reloads the page, so withdrawn scripts stop and newly allowed content, e.g. a background video, starts straight away.

The law singles out only what is strictly necessary. A website's other services are usually divided into three categories so that the visitor can choose what to agree to.

CategoryExamplesConsent needed
Necessarysession, cart, login, security, remembering the choice in the bannerNo
Functionalchat, maps, embedded videos, remembered languageYes
AnalyticsGoogle Analytics 4, HotjarYes
MarketingMeta Pixel, Google Ads, TikTok, LinkedInYes

Necessary means the site does not work without it. Chat, a map or an embedded video are extras, so the visitor must be able to refuse them. If something the site really needs stops working without consent, it has probably been put in the wrong category.

The opposite mistake is listing analytics as necessary so that it runs without consent. In consetgo, tracking tools cannot be assigned to the necessary or functional category: GA4 and Hotjar can be analytics or marketing, while Meta Pixel, TikTok, LinkedIn and Google Ads can only be marketing.

The banner alone blocks nothing. If the Google Analytics code is in the site's theme, the browser runs it on page load, before the visitor clicks anything. Consent must come before storage, so scripts from categories that require consent have to wait for the decision. The same applies to frames: a YouTube video or a Google map connects to Google's servers as soon as the page loads.

Scripts can be held back in two ways. The first is to insert them conditionally, e.g. in Google Tag Manager with triggers that depend on consent – this requires reviewing every tag and any code pasted outside GTM. The second is a module that rewrites the page code before it reaches the browser.

The consetgo module works the second way, on the website's server. Analytics and advertising scripts get the type “text/plain”, so the browser does not run them, and videos and maps are replaced by a “Content blocked” frame with an “Allow and show” button. After consent, only what the visitor agreed to is unblocked. Code that is already on the site – in the theme, in a plugin or in Google Tag Manager – is found by the scanner, which recognises more than 50 services. How it works: How consetgo works.

Since March 2024 Google has required websites that use Google Ads and measurement for traffic from the European Economic Area to pass consent signals via Consent Mode v2. Consent Mode does not replace the banner – it passes to Google the decision the visitor made in the banner. More: Google Consent Mode v2.

Article 7(1) GDPR requires the controller to be able to demonstrate that the person has consented. In Orange Romania the CJEU ruled that it is the controller who must prove that consent was valid. A choice saved in a cookie stays in the visitor's browser, so the website owner needs its own record.

The record of each decision should make it possible to reconstruct what the visitor saw and what they chose:

  • date and time of the decision,
  • scope: which categories they accepted and which they rejected,
  • the version of the banner text and the list of services they saw.

In consetgo, changing the banner texts or the list of services creates a new version, and the banner asks visitors again. The consent log records the date, scope and content version on your website's server (for 24 months by default), lets you export entries to CSV and print proof of a single consent.

Common mistakes

  1. Scripts run before the decision because the code is in the theme, in a plugin or in a Google Tag Manager tag without a consent condition.
  2. No “Reject” button on the first screen – rejecting requires going into the settings.
  3. Accept in a highlighted colour, reject as a grey, barely visible link.
  4. Categories pre-ticked in the settings window.
  5. Relying on “legitimate interest” instead of consent for statistics and advertising.
  6. Treating scrolling or continued browsing as consent.
  7. A “cookie wall”, i.e. content available only after acceptance.
  8. No icon or link to change the decision after the banner is closed.
  9. Statistics or an advertising pixel listed in the necessary category.
  10. Missed embeds: a YouTube video, a Google map, a third-party chat.
  11. The list of services in the banner and in the privacy policy is out of date after a new tool is added.

Points 2–5 match the infringements that, according to the 2023 EDPB report, authorities challenge most often. We discuss the EDPB guidelines on the EDPB guidelines page and the judgments on the CJEU judgments page.

Implementation step by step

Whatever tool you use, implementing a banner involves a few fixed steps. The order matters: a banner without script blocking only displays a message.

  1. List of services. Establish what the site really loads: analytics, advertising pixels, chat, maps, videos, fonts from external servers, tags in Google Tag Manager. The most reliable way is to check in the browser, on several pages – the code in the templates does not show tags added by GTM.
  2. Categories. Assign each service to a category according to what it does: necessary, functional, analytics, marketing. Analytics and advertising tools do not go into necessary.
  3. Blocking until consent. Scripts, frames and pixels from categories that require consent must not run before the visitor chooses. If you use Google Ads or GA4, also set up Google Consent Mode v2 signals.
  4. Banner. On the first screen, “Accept all” and “Reject all” in the same style, and links to the category settings and to the privacy policy. Categories other than necessary off at the start.
  5. Changing consent. A permanent icon or footer link that opens the settings on every page.
  6. Privacy policy. A table of services and cookies consistent with what the site actually sets – name, provider, purpose, storage period, transfers outside the EEA.
  7. Proof of consent. A record of the decision with the date, the version of the banner text and the categories; after a change of services or texts – asking for consent again.
  8. Test. In a private window, check that services requiring consent do not load before the decision and after rejection – the test is described in the article How to check whether a website sets cookies before consent.

How to implement the banner with consetgo

You install the consetgo module on the website's server: as a plugin in WordPress, Joomla, PrestaShop, Drupal and TYPO3, or manually on a PHP website (requires PHP 7.2 or later). After installation, in the Scanner tab you enable scan mode and click through a few pages, then check the services and categories, and finally the look and texts of the banner. A ready-made cookie table for the privacy policy is in the Cookie policy tab. Instructions for individual systems: Installation guides.

The module provides the tools, but the website owner is responsible for the configuration – including assigning services to categories and the content of the privacy policy. Each domain gets a 14-day free trial. An annual licence costs €10 gross for a website and €30 gross for an online shop (in Poland PLN 40 and PLN 100 net plus 23% VAT). Details in the price list.

Checklist before publishing

  • List of services made in the browser, on several pages (including the cart and the contact page).
  • Each service in the category that matches what it does – see how to assign cookie categories to services.
  • Before the decision and after rejection: no _ga, _fbp, _gcl_au or similar cookies and no requests to analytics and advertising services.
  • “Accept all” and “Reject all” on the first screen, in the same style – more in the article “Accept all” and “Reject all”.
  • Categories other than necessary off at the start; the close (×) button and scrolling do not save consent.
  • An icon or link to change consent on every page.
  • Videos and maps show a placeholder with a button instead of loading before consent.
  • Google Consent Mode v2 with default values “denied” before Google tags, if you use Google Ads or GA4.
  • The cookie table in the privacy policy matches the scan result.
  • The consent log works and records the version of the banner text.

Questions and answers

Does a small company website also need a cookie banner?

The consent rule has no exception for small businesses. What counts is what the site stores and reads in the browser: if it runs analytics, an advertising pixel or an embedded video, it needs the visitor's consent.

Can the “Reject” button be only in the settings?

The EDPB Cookie Banner Taskforce lists a missing reject button on the first layer of the banner among the infringements that authorities challenge most often. It is safer to place “Reject all” next to “Accept all”.

Does Google Consent Mode replace the banner?

No. Consent Mode passes to Google the decision the visitor made in the banner, so the banner and script blocking are still needed.

How long should proof of consent be kept?

Agree the retention period with the person responsible for data protection in your company. In the consetgo module, the consent log keeps entries for 24 months by default, on your website's server.

This is general information, not legal advice.

Read also

How to write clear cookie banner texts – rules and examples

How to write clear cookie banner texts – rules and examples

Law and cookies

Consent is valid only if the visitor understands what they are agreeing to. What the banner texts must make clear, how to name buttons and categories, examples of neutral texts and what happens after you change them.

· 6 min read

Dark patterns in cookie banners – what to avoid

Dark patterns in cookie banners – what to avoid

Law and cookies

Deceptive design patterns in cookie banners according to EDPB Guidelines 03/2022 and the report of the EDPB Cookie Banner Taskforce. What follows from the law, what is the authorities' position and how to check your own banner.

· 6 min read