my-appengineer Courses

Cookie consent and analytics rules in your country

Measurement foundations: plan, tools and consentLesson20 min4 / 22

Analytics touches two sets of European rules at the same time. Get them confused and you either measure nothing or break the law. This lesson explains the principle, shows how regulators differ, and gives you a test to check that your banner actually works.

Watch out

This lesson is a practical explanation, not legal advice. Rules and regulator guidance change, and they differ per country. Check the current guidance of your own regulator (links below) and ask a privacy professional when your setup is not standard.

Two rules, two questions

1. The ePrivacy rule: may you store or read something on the device?

The EU ePrivacy Directive says that storing information on a visitor's device, or reading it from there (cookies, local storage, device fingerprinting), needs prior consent, unless it is strictly necessary for a service the visitor asked for. A shopping-cart cookie is strictly necessary; an analytics or advertising cookie normally is not. Each EU country has written this into its own law, which is why details differ.

2. The GDPR: may you process personal data, and on what basis?

If your analytics processes personal data (an IP address, a cookie ID, a user ID), you need a legal basis under the GDPR, you must be transparent in your privacy notice, you must keep data minimal and secure, and you need a contract (DPA) with your tool provider. For analytics that relies on cookies requiring consent, the legal basis is in practice that same consent.

The practical upshot:

  • Strictly necessary cookies (cart, login, security, the consent choice itself): no consent needed, but mention them.
  • Analytics cookies: normally consent needed. Some countries allow an exemption for limited, privacy-friendly audience measurement (see below).
  • Marketing and advertising cookies and pixels: consent needed.

What valid consent looks like

Across the EU, valid consent is freely given, specific, informed and unambiguous, and it must be as easy to withdraw as to give. For a cookie banner that means:

  • No tags before the choice. Analytics and marketing scripts that need consent wait until the visitor agrees.
  • Reject as easy as accept. Several regulators say a "Reject all" button belongs on the first layer, next to "Accept all", with equal visual weight.
  • No pre-ticked boxes. The Court of Justice of the EU confirmed this in the Planet49 case (2019).
  • Purposes explained in plain language, with a link to your cookie policy.
  • Withdraw any time, for example through a "Cookie settings" link in the footer.
  • Proof: keep a record of consent (most consent tools do this).
  • No cookie wall that blocks the site unless the visitor accepts; regulators are critical of this, with some nuance per country.

The analytics exemption: where regulators differ

This is where countries really differ, and it matters for your tool choice from the previous lesson.

  • France (CNIL): the CNIL has published conditions under which audience measurement can be exempt from consent: strictly limited to producing anonymous statistics for the site owner, no cross-site tracking, no combining with other data, limited retention, and the visitor can object. It publishes guidance on configuring tools to meet these conditions.
  • The Netherlands (Autoriteit Persoonsgegevens): the Dutch Telecommunicatiewet has an exemption for analytical cookies with little or no impact on privacy. The AP explains on its website when analytics qualifies, for example with data shared with nobody else and IP addresses masked.
  • Germany: the TDDDG (formerly TTDSG) only exempts what is strictly necessary, and German data protection authorities take a strict view of analytics without consent. Plan for consent unless your setup clearly stores and reads nothing on the device.
  • Poland: cookie rules sit in the electronic communications law (since late 2024 the Prawo komunikacji elektronicznej), and UODO supervises the GDPR side. Check the current guidance and which authority enforces which part.
  • UK (ICO): the UK has its own PECR and UK GDPR. The Data (Use and Access) Act 2025 introduces exemptions for certain low-risk cookies, including some analytics, under conditions. Check on the ICO website which parts are in force.
The CNIL's page on solutions for audience measurement tools
The French regulator CNIL explains when audience measurement can be exempt from consent (page in French).
How it works in your country

Check how this works in your country before you install analytics. Examples: in the Netherlands the Autoriteit Persoonsgegevens (cookies and the Telecommunicatiewet), in Poland UODO for the GDPR and the electronic communications law for cookies, in France the CNIL (audience measurement exemption), in the UK the ICO (PECR and the Data (Use and Access) Act 2025), in Germany your state's data protection authority and the TDDDG. Outside Europe, laws such as California's CCPA/CPRA work with opt-out rights instead. Write down the date and the source of the guidance you followed.

Background

Which country's rules apply? As a rule of thumb, the rules of the country where your business is established, and for visitors in other EU countries their regulators may also take an interest. If you sell actively to several countries, follow the strictest guidance that applies to you, or get advice.

Choosing a consent tool

A consent management platform (CMP) shows the banner, stores choices and switches tags on and off. When you choose one, check:

  1. Does it block scripts until consent, rather than only showing a banner?
  2. Does it support Google Consent Mode v2 if you use Google tags? (Explained in the course Paid advertising.)
  3. Can you show Reject all on the first layer?
  4. Does it keep a consent log?
  5. Does it offer your languages?
  6. Where does it store data, and is there a DPA?

If you chose a setup that may run without consent (for example a cookieless tool configured according to your regulator's conditions), you may not need a banner for analytics at all, but you still describe the tool in your privacy notice. As soon as you add marketing pixels or heatmaps that need consent, you need the banner again.

Watch out

A BIAB shop has no field for a consent tool or third-party scripts: under Settings → SEO you only enter fixed IDs (Google Analytics, AdSense, Search Console, Merchant Center). The shop shows its own cookie banner with fixed platform text, but Google Analytics and AdSense currently load without waiting for consent, so keep that in mind before you enter those IDs. Do not paste tags into your site that fire without consent "for now". For apps you build yourself on my-app.engineer, you can ask the builder to add a consent banner that blocks tags until the visitor agrees, and then test it as below.

The 10-minute consent test

Run this after every change to your tags or banner:

  1. Open your site in a private window (no old cookies).
  2. Open the browser's developer tools → Network tab, and the Application (or Storage) tab for cookies.
  3. Before clicking anything: check that no analytics or marketing requests go out (search the network list for names like google-analytics, collect, facebook, tiktok, clarity, hotjar) and that no such cookies are set. Exempt tools you deliberately configured for your country are the only exception.
  4. Click Reject all. Browse three pages and add something to the cart. Check again: still nothing.
  5. Open a new private window, click Accept all, and check that the tags now fire.
  6. Use your footer link to withdraw consent, reload, and check that tags stop.
  7. Write down the date and the result.
Ask Claude
I am in [country] and my site [describe: webshop / SaaS / course site] uses these tools: [list analytics, heatmap, ads pixels, consent tool]. Make a table with, per tool: what it stores or reads on the device, whether it processes personal data, which consent category it belongs to (strictly necessary / analytics / marketing), and the regulator guidance I must check to see whether an analytics exemption could apply in [country]. Then write a draft text for the cookie section of my privacy notice in plain English. Do not tell me a tool is definitely exempt; list the conditions I must verify.
Your task

Look up your regulator's guidance on analytics cookies. Write down in your measurement plan: does your chosen analytics setup need consent (yes / no / unclear, with the source and date)? Then run the 10-minute consent test on your current site, or schedule it for the day your tracking goes live.

This course is general information, not personal legal, tax or financial advice. Rules, amounts and dates change: check the official source for your country before you act.