Trackers before consent
A page loads, the analytics tag in its <head> runs, a cookie with a visitor ID is stored and the first request goes out to the analytics company. The cookie banner shows up a moment later, asking for a choice that has already been made for the visitor. Trackers before consent is the name for that ordering fault: an analytics or advertising script, pixel or cookie that stores or reads information on the visitor's device before the visitor has agreed to it. In the European Union the rule it breaks is Article 5(3) of the ePrivacy Directive, which makes such storage and access depend on the user's consent.1 Two cases are exempt: storage needed only to carry a communication over the network, and storage strictly necessary for a service the user explicitly asked for.2
What the rule covers
The rule attaches to the device. In the Planet49 judgment of October 2019 the Court of Justice held that it applies whether or not the stored or read information is personal data, since its purpose is to stop hidden identifiers from entering a user's equipment without their knowledge.1 A cookie that holds a random ID is covered. A value in localStorage, the browser's built-in storage for scripts, is not touched by the rule while it stays inside the browser, and comes under it once a script sends it to a server.2
Guidelines adopted by the European Data Protection Board in October 2024 read the scope widely. A tracking pixel is in scope, and so is an identifier appended to a link or an image address. For a pixel that JavaScript builds at run time, delivering that JavaScript to the browser counts as the instruction that brings the rule into play. The page that tells the browser to send data and the company that receives it can be different parties, as with a site that embeds an advertiser's pixel. Tracking by IP address alone can also fall under the rule, because a static IPv4 address from a home router counts as coming from the user's equipment, and so does an IPv6 address, which the device partly sets itself.2 The Board adds that being in scope does not always mean consent is needed; each case still has to be weighed against the exemptions.2
The exemptions are narrow. A cookie that remembers what is in a shopping basket is unlikely to need consent. A cookie that is helpful or convenient without being essential, or that is essential only for the site owner's own purposes, still does.3
Consent that counts
The UK regulator's guidance says consent comes from a positive act, such as ticking a box or clicking a link, and carrying on with the site is not one.3 A checkbox that arrives ticked and has to be unticked to refuse gives no valid consent. Agreement to something else on the same screen, such as entering a prize draw, does not extend to cookies, and the visitor must be told how long the cookies last and whether third parties can read them.1 The same guidance rules out setting non-essential cookies on a site's home page before the visitor has agreed.3
Consent mode and cookieless pings
Google's tag has no consent state unless the page gives it one. The page has to call gtag('consent', 'default', ...) on every page, before any config or event command, because defaults set out of order do not work. A banner that loads asynchronously can be given time with wait_for_update, a delay in milliseconds before tags send anything.4
Google describes two setups. In the basic one the Google tags stay blocked until the visitor agrees. In the advanced one the tags load before the banner, and while consent is denied they set no cookies but send cookieless pings, which can carry the user agent (the browser's name and version), the screen resolution and the IP address. Fields the site adds itself, such as a user ID, are sent as normal.5 The Board's guidelines bring requests that a script tells the browser to send, and tracking by IP address, within the rule's scope, so a ping can fall under the rule with no cookie in it.2
Holding tags until a choice
For Google tags, the default call goes first, ahead of the tag's own configuration, and the banner's buttons change the state:
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('consent', 'default', {
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'analytics_storage': 'denied'
});
</script>
<!-- the Google tag snippet follows here -->
<script>
// called by the banner when the visitor accepts analytics cookies
function acceptAnalytics() {
gtag('consent', 'update', { 'analytics_storage': 'granted' });
}
</script>The same update command with 'denied' handles a visitor who later withdraws consent.4
For other vendors, consent tools such as Klaro use a blocking pattern: the script's src moves to data-src, its type becomes text/plain with the original type kept in data-type, and a data-name ties it to an entry in the tool's configuration.6 A browser treats a script whose type is not a JavaScript type as a data block, ignores its src and never fetches it.7 The tool runs the script only once the visitor has agreed to that entry.
<script type="text/plain" data-type="text/javascript"
data-name="analytics" data-src="https://example.com/analytics.js"></script>Enforcement
On 10 December 2020 the French regulator CNIL fined Google LLC 60 million euros, Google Ireland 40 million euros and Amazon Europe Core 35 million euros under Article 82 of the French Data Protection Act, which puts the ePrivacy rule into French law. Inspectors had found that a visit to google.fr set seven cookies at once, four of them for advertising. On amazon.fr, a first visit to the home page, or arrival through an Amazon ad on another site, set more than 40 advertising cookies with no action by the visitor. Both companies had stopped setting the cookies automatically in September 2020.8
In SecFlash
On the Security page, SecFlash reports third-party cookies set before consent as SF-SEC-502, and a tag that sends data on page load, before the visitor has chosen anything, as SF-SEC-507. A tag that keeps sending after the reject button was clicked is SF-SEC-506, and an email, name or user ID passed to an advertising company is SF-SEC-505.
See also
- Third-party requests
- GDPR for application builders
- Personal data in URLs
- Cookie attributes
- Data retention
- Category: Data exposure
References
- a b c Court of Justice of the European Union (1 October 2019). "Storing cookies requires internet users' active consent", press release No 125/19, Case C-673/17 Planet49. CURIA.
- a b c d e European Data Protection Board (7 October 2024). "Guidelines 2/2023 on Technical Scope of Art. 5(3) of ePrivacy Directive", version 2.0. EDPB.
- a b c Information Commissioner's Office. "Cookies and similar technologies". Guide to PECR. ICO.
- a b Google. "Set up consent mode on websites". Google Tag Platform. Google for Developers.
- back Google. "About consent mode". Analytics Help. Google.
- back Klaro. "Managing third-party apps/trackers". klaro-js README. GitHub.
- back MDN contributors. "<script>: type attribute". MDN Web Docs. Mozilla.
- back Hunton Andrews Kurth (14 December 2020). "CNIL Fines Google and Amazon 135 Million Euros for Alleged Cookie Violations". Privacy & Cybersecurity Law Blog.