Consent compliance proposal: the banner against the rules, Global Privacy Control, defaults the plugin enforces, the spec shared with IAWL

Design only, no code. First cut for 1.17.0 needs no schema change; eight yes-or-no decisions for the owner.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-11-26 13:25:34 +01:00
co-authored by Claude Fable 5.2
parent 9520e61b15
commit 41771fd51a
+549
View File
@@ -0,0 +1,549 @@
# Consent compliance: where the banner stands, Global Privacy Control, and what the plugin enforces
Design proposal, 2026-11-26. No code is changed by this document. Line numbers refer to local `main` at `2f6a81a`
(1.17.0, unreleased); the branch `claude/consent-banner-first-paint-154f9f` (`177620d`) moves some of them and is
taken as merged for the build plan (§8).
Owner's direction (2026-11-26): Global Privacy Control should be honoured, and the banner's correct working must be
ensured by the plugin itself, not left to each site's settings. The work is part of 1.17.0.
**This is an engineering reading of the rules, not legal advice.** Sources were looked up on 2026-11-26 and are cited
in §9 with what could not be verified in §10. Three kinds of rule are kept apart throughout:
- **LAW**: a statute or a court ruling that binds.
- **GUIDANCE**: what a regulator or the EDPB says it expects. Not binding, but it is how a complaint is judged.
- **VENDOR**: a contract term of Google, Microsoft or Meta. The sanction is losing the product, not a fine.
## 0. Summary
1. The banner is sound on the points that are plain law: nothing is pre-ticked, choice is per category, a refusal is
one click on the first layer, the choice is re-asked after 180 days and after a policy change, non-Google tags
load only after consent.
2. Five gaps matter. (a) With the default `consentMode: 'advanced'` the Google tag loads and sends pings before
consent; under the EDPB's reading of the ePrivacy rule that needs consent. (b) "Reject" looks weaker than
"Accept all" unless a site sets `equalChoice`. (c) Withdrawing consent does not stop tags that already run on the
page and does not clear browser storage keys. (d) The default text lacks a sentence Polish law asks for
(settings in the browser). (e) Microsoft Clarity never receives a consent signal on a site without GA4 / GTM.
3. Global Privacy Control has no binding force in the EU today. It is still the only browser signal with a
specification and growing browser support, and both EU drafts under negotiation point to "do not ask again after
a refusal". The design treats it as a refusal of analytics and marketing that the visitor did not have to click:
no banner, no tracker request (also not Google's), and an explicit choice in the settings window still wins.
Everything is decided in the browser before the first paint, so pages stay static and no `Vary` is needed.
4. "Enforced by the plugin" becomes: four defaults that need no project setting (GPC honoured, equal choice, nothing
to Google before consent, withdrawal that really stops), each with an opt-out; doctor rules and a browser check
that fail loudly; and the consent log, which stays an option in 1.17.0 because turning it on adds a table.
5. The first cut needs **no schema change and no migration** on any site (§6).
6. IAB TCF and a Google-certified CMP are not needed by any site that only measures and advertises. They are needed
only by a site that *shows* ads through AdSense, Ad Manager or AdMob (§5).
## 1. Where the banner stands against the rules
### 1.1 The rules in one paragraph each
- **Poland, LAW.** Prawo komunikacji elektronicznej (PKE), art. 399: storing information on a visitor's device, or
reading it, needs (1) clear prior information about the purpose *and about the possibility of setting the conditions
in software settings*, (2) consent, (3) no change to the device's configuration. Art. 399 ust. 3 exempts what is
necessary for transmission or for a service the visitor asked for. Art. 400: GDPR's consent rules apply. Art. 399
ust. 2 still says consent can be given through software settings; because art. 400 imports GDPR consent (an active,
informed act), a browser's default settings are not safe to rely on. Supervision of art. 399: Prezes UKE, fines up
to 3% of revenue (art. 444, 446). The personal data processed afterwards: Prezes UODO under GDPR.
- **EU, LAW.** GDPR art. 4(11), 7 (consent: freely given, specific, informed, unambiguous; demonstrable; withdrawal
as easy as giving), art. 13 (information), art. 21 (objection). CJEU C-673/17 *Planet49*: a pre-ticked box is not
consent; the visitor must be told how long cookies last and whether third parties get access.
- **EU, GUIDANCE.** EDPB Guidelines 05/2020 on consent; the EDPB Cookie Banner Taskforce report (2023), a minimum
common position of the authorities; EDPB Guidelines 2/2023 on the technical scope of ePrivacy art. 5(3) (2024),
which put script-instructed requests, pixels and tracked URLs in scope whether or not a cookie is involved. UODO
has published an article (Biuletyn, 2025-03-31) that repeats the EDPB positions; no formal UODO banner guidelines
and no UODO or UKE fine for a banner were found.
- **VENDOR.** Google's EU user consent policy (consent before Google tags use storage or personal data for ads,
records of consent, clear way to revoke, each party named) and Consent Mode v2 (signals required for EEA traffic);
Microsoft Clarity and UET (a consent signal is enforced for EEA / UK / Swiss visits); Meta Business Tools Terms
s.3.d (consent, verifiably, before the Pixel is used).
### 1.2 Requirement → today → gap
| # | Requirement | Kind | What the plugin does today | Gap |
|---|---|---|---|---|
| 1 | No non-essential **storage** before consent | LAW (PKE 399; Taskforce ¶7) | Non-Google pixels load only when their category is granted (`src/modules/analytics/Analytics.tsx:181-188`). Google starts with every signal `denied` (`src/modules/consent/googleConsent.ts:45-50`, called before the tag at `Analytics.tsx:154-159`). `ConsentScript` gates other scripts (`src/modules/consent/ConsentScript.tsx:72-76`). Language cookie only with functional consent (`src/modules/i18n/localeMiddleware.ts:104-109`). Visitor id only with analytics consent (`src/modules/stats/PageStats.tsx:71`). | None in the plugin's own code. A project can still add a tag by hand; the browser check and the crawl catch it (`scanner/crawl/violations.ts:61-65`). |
| 2 | No non-essential **requests** before consent | GUIDANCE (EDPB 2/2023 ¶33, 51, 53: a script that makes the browser send information is "gaining access"). No authority has ruled on Consent Mode by name. | Default `consentMode = 'advanced'` (`Analytics.tsx:135`, `shouldLoadGoogle.ts:22`): `googletagmanager.com` loads at once and sends cookieless pings (timestamp, user agent, referrer, consent state, a random number per page load; the IP address travels with every request). `'basic'` sends nothing to Google before consent. The crawl treats Google's hosts as allowed in `advanced` (`violations.ts:66`). | **Yes.** The default is the risky one. → §3.2 item B. |
| 3 | Refusing as easy as accepting, on the first layer | GUIDANCE (Taskforce ¶8: an infringement for "a vast majority" of authorities; CNIL: accept and refuse at the same level). Colour and contrast: case by case (Taskforce ¶15-19). | "Reject" is on the first layer by default and is one click (`CookieBanner.tsx:197`, `:251`). It is styled as the secondary (text-only) button unless `equalChoice` is set (`CookieBanner.tsx:203`, `:244`). A project can drop it with `order`. | **Yes**, in the default look and in the unguarded `order`. → §3.2 item C. |
| 4 | No pre-ticked choices | LAW (*Planet49*) | All optional categories start `false` (`categories.ts:11-16`); the settings controls show that state (`CookieBanner.tsx:212`, `:274`). No consent by scrolling, closing or continuing. | None. |
| 5 | Granular choice per purpose | LAW (GDPR 4(11) "specific"; EDPB 05/2020 ¶42-44) | Four categories, each switchable, "Save" in the settings view (`CookieBanner.tsx:387-401`). | None. Purposes are per category, not per vendor; no rule found that requires per-vendor switches outside TCF. |
| 6 | Withdrawal as easy as giving, and it stops the processing | LAW (GDPR 7(3)) | `CookieButton` reopens the banner at any time (`CookieButton.tsx:36-66`). On a category going from on to off the listed cookies are deleted, also on parent domains (`useConsent.ts:46-51`, `:96-103`), and Google gets the update (`:115`). | **Yes, three parts.** (1) Pixels already running keep running until the next page load (`ConsentScript.tsx:56-59`, `docs/analytics.md:158-160`); Meta, Clarity and TikTok have revoke calls that are not used. (2) Only cookies are deleted, not `localStorage` / `sessionStorage` keys, although the cookie list knows their type (`texts.ts:4`). (3) A site can pass `cookieButton={false}` and leave no way back. → item D, checks. |
| 7 | Consent is re-asked after a period | GUIDANCE (CNIL, DPC, Garante: about 6 months; AEPD: at most 24; EDPB: "appropriate intervals"). No Polish figure. | Consent cookie lives 180 days (`storage.ts:15`), a refusal equally; a new *Consent version* asks again (`storage.ts:47`). | None on the period (it is a constant, not an option). Not verified: browsers that cap script-written cookies (Safari, 7 days) would ask weekly (§10). |
| 8 | Proof of consent | LAW that it must be demonstrable (GDPR 7(1)); **how** is free (EDPB 05/2020 ¶104-108). VENDOR: Google asks for records (text shown, choices, time). | Cookie holds id, choices, policy version, time (`storage.ts:17-23`). Optional log `consent-records` with id, version, choices, time, no IP and no user agent (`consentLog.ts:56-65`, `:101-109`); off unless `consentLog` is set (`plugin.ts:782`). | **Partly.** No source requires a per-visitor server log; CNIL and the German DSK accept documented versions of the banner and its texts. What is missing either way: a kept copy of the *text shown* per policy version. The log is off on sites that never turned it on. → item E. |
| 9 | Information before the choice: purposes, who receives data, how long, how to change one's mind | LAW (PKE 399 ust. 1 pkt 1; GDPR 13; *Planet49*) | First layer: one general sentence and a privacy-policy link when the system page is set (`getConsentTexts.ts:39-40`, `:72-73`, `:175-191`). Second layer in `settings="detailed"`: cookies per category with provider, purpose, duration (`CookieBanner.tsx:308-355`). | **Yes.** (1) The default text does not say that conditions can also be set in the browser (PKE 399 ust. 1 pkt 1 lit. b) nor how to withdraw. (2) Providers and durations are visible in the banner only in `detailed`; the default is `inline` (`CookieBanner.tsx:206`). (3) `privacyLink` is `null` when the page is not set. → item F, checks. |
| 10 | The cookie list is kept true; "necessary" is justified | GUIDANCE (Taskforce ¶26-30: the site must be able to show why a cookie is essential) | Cookie scanner, one approval, scheduled crawl with violations and e-mail (`docs/cookie-scanner.md`); doctor fails when the scanner is off (`doctor/rules/security.ts:260-268`). | Small: a raised cookie list does not raise the *Consent version* by itself; the editor must (`docs/consent.md:385-387`). → check. |
| 11 | Embedded third-party content (video, maps) | GUIDANCE (CNIL FAQ: consent when the visitor activates it; DSK: no legitimate interest where the provider uses data itself). EDPB 2/2023 treats local storage like cookies. | `YouTubeEmbed`: poster and play button, the player (`youtube-nocookie.com`) loads on click (`src/modules/storage/YouTubeEmbed.tsx:33-45`). No map component. | **Small.** (1) Without an uploaded poster the thumbnail comes from `i.ytimg.com` at page load (`YouTubeEmbed.tsx:48`): a request to Google before any choice. (2) The text that playing contacts YouTube is optional (`note`). (3) The click is not recorded as a consent and is not tied to a category. → item G. |
| 12 | Fonts | COURT, Germany, first instance (LG München I, 3 O 17493/20): loading Google Fonts from Google sent the IP without a basis | The starter uses `next/font/google`, which downloads at build and serves from the site (`starter/generate.ts:214`). The plugin loads no font. | None. A check for a `fonts.googleapis.com` / `fonts.gstatic.com` request is worth adding to the crawl's host list. |
| 13 | Consent signals to vendors | VENDOR | Google: seven signals mapped from the categories (`googleConsent.ts:6-17`), default then update. Clarity, Meta, LinkedIn, TikTok: loaded after consent, **no signal sent** (`analytics/pixels.ts:19-55`). | **Yes for Clarity.** Clarity needs a signal for EEA visits; it reads Google's automatically, but the Google default is pushed only when GA4 or GTM is configured (`Analytics.tsx:156`). A site with Clarity and no Google tag runs Clarity cookieless forever. `ads_data_redaction` is not set. UET is not a plugin integration (through GTM only). → item D. |
| 14 | Global Privacy Control | No EU duty today (§2.2) | Not read. `docs/consent.md:407` says it is not needed. | → §2. |
| 15 | No tracking the visitor cannot see | LAW (GDPR 5, 13) | Built-in statistics count a visit without storage and without consent through a daily-salted hash, no IP or user agent kept (`stats/collection.ts:10-14`). | None found. Whether this counts as "access" under EDPB 2/2023 is arguable; both EU drafts exempt first-party aggregate audience measurement. Named here so it is a known position. |
## 2. Global Privacy Control
### 2.1 What the signal is
- A browser setting that says: do not sell or share my personal data with third parties. W3C Working Draft (Privacy
Working Group, latest 2026-09-24), not yet a standard.
- **Request header** `Sec-GPC: 1` on HTTP requests. The only valid value is `1`; absence means "no preference", there
is no "off" value. It is a `Sec-` header, so page script cannot forge it.
- **Script property** `navigator.globalPrivacyControl`: `true` when the header would be sent, `false` otherwise,
`undefined` in browsers without support. Only `=== true` counts.
- **Site statement** `/.well-known/gpc.json`: `{ "gpc": true, "lastUpdate": "<date>" }` says the site intends to
honour the signal.
- **Who sends it:** Brave and DuckDuckGo by default; Firefox as a setting and by default in private windows;
extensions for Chrome and Edge. Chrome and Safari are adding a setting (California requires browsers to offer one
from January 2027). No reliable share of traffic is published.
- Do Not Track is not read: the W3C work was closed in 2019 and Firefox removed the setting in 2025. One caution: a
Berlin court (LG Berlin, 16 O 420/19, 2023, not final) held that a DNT signal is a valid objection, so a site
should never *state* that it ignores browser signals.
### 2.2 Legal weight
- **Outside the EU: binding.** California (11 CCR §7025) and eleven more US states require honouring it as an opt-out
of sale, sharing and targeted advertising; fines have been imposed (Sephora 2022 and later cases). A specific
consent given to the site after the signal may prevail.
- **In the EU: not binding as such.** No regulator has said GPC must be honoured. The hooks are GDPR art. 21(5)
(objection "by automated means using technical specifications") and art. 7(3) (withdrawal). The specification's
own explainer says no European regulator has made that case yet.
- **Coming, not settled.** The Commission's Digital Omnibus (COM(2025) 837) proposed a duty to respect
machine-readable signals (new GDPR art. 88b) and no new request for six months after a refusal. The Council's
mandate of 2026-10-21 drops the signal duty and keeps "no new request for at least four months" and one-click
refusal. Parliament has no position; nothing is adopted. Earliest effect: 2028 or later.
- **Practical meaning for an EU site today:** optional categories are already off until opt-in, so GPC changes
nothing about storage. What it can change is (a) whether the visitor is asked at all, (b) whether anything is sent
to a third party before a choice, (c) what happens to an earlier consent when the signal appears.
### 2.3 Design
One rule: **GPC is a refusal of analytics and marketing that the visitor did not have to click. A choice the
visitor makes on this site while the signal is on is specific and wins.**
**Modes** (one setting, default `'honour'`):
| Mode | With GPC and no stored choice | Use |
|---|---|---|
| `'honour'` (default) | No banner. Analytics and marketing off. No tracker request, also not to Google in `advanced`. The cookie button is shown; the settings window explains the signal. | The default for every site. |
| `'ask'` | The banner is shown as usual. Until a choice is made nothing is sent to any tracker, also not to Google in `advanced`. | A site that wants to keep asking. |
| `false` | The signal is ignored (today's behaviour). | Opt-out. Doctor reports it. |
**What it sets.**
- Categories: `analytics` = off, `marketing` = off. `functional` is not touched by the signal (it is not sharing);
with no stored choice it is off anyway, as for everyone. `necessary` stays on.
- Consent Mode: `ad_storage`, `ad_user_data`, `ad_personalization`, `analytics_storage` = `denied` (the default
already). In addition the Google tag is **not loaded** while the signal applies, whatever `consentMode` says:
`shouldLoadGoogle` gets the signal as an input. `ads_data_redaction` is set to `true`.
- Clarity, Meta, LinkedIn, TikTok, `ConsentScript`: not loaded (they follow the categories).
- Built-in statistics: the cookieless count continues (first party, nothing shared, nothing stored). The visitor id
cookie is not set.
- Nothing is written for a visitor who only sends the signal: no consent cookie, no log record. The state is
derived from the signal on every page.
**Interaction with an explicit choice.** The stored record gets one new field, `gpc`: was the signal on when the
choice was made.
| Stored choice | Signal now | Result |
|---|---|---|
| none | on | Mode `'honour'`: as above. |
| made with the signal on (`gpc: true`) | on | The stored choice stands, also when it grants analytics or marketing: the visitor chose this for this site while the signal was on. |
| made with the signal off (`gpc: false`) | on | The signal is newer than the choice: analytics and marketing are switched off, their cookies and storage keys deleted as on a withdrawal, the record rewritten with those two off and `gpc: true`. The visitor can grant again in the settings window. |
| made before this version (no `gpc` field) | on | The stored choice stands until it expires or the visitor changes it. We cannot know which came first, and a silent withdrawal on upgrade day would be the larger surprise. |
| any | off | The stored choice stands. The absence of the signal is never consent. |
"Accept all" on the first layer is not offered to a `'honour'` visitor, because the first layer is not shown. In the
settings window, opened from the cookie button, the visitor switches categories and saves; that is the explicit,
informed choice. In `'ask'` mode "Accept all" works as usual and the record carries `gpc: true`.
**What the visitor sees.** Mode `'honour'`: no banner; the cookie button; in the settings window, above the
categories, one line (PL / EN defaults in code, overridable through `texts`): *"Twoja przeglądarka wysyła sygnał
Global Privacy Control. Analityka i marketing są wyłączone. Możesz je włączyć dla tej witryny poniżej."* / *"Your
browser sends a Global Privacy Control signal. Analytics and marketing are off. You can turn them on for this site
below."* The same line appears in the banner in `'ask'` mode.
**What the consent log records.** In 1.17.0 nothing changes in the log's shape (a new field is a column, §6). The
cookie record carries `gpc`; the request to the log may carry it and the endpoint ignores it. A later release that
carries a migration adds `gpc` and `source` (`banner` / `settings` / `gpc`) to the log.
**Server and browser.**
- **Browser, the default path.** The pre-paint script of the first-paint branch (`consentBannerScript`) also reads
`navigator.globalPrivacyControl`: signal on and no stored choice → the banner stays hidden. The consent store adds
the signal to its snapshot, so `useConsent` returns the effective state and `gpc: boolean`. The page HTML is the
same for every visitor.
- **Server, only where a response is already per visitor.** A helper `gpcFromHeaders(headers)` is exported. The
statistics endpoint uses it: a visitor id is not accepted when `Sec-GPC: 1` arrives with a stored choice that has
`gpc: false`. The consent log endpoint may use it later to record the signal as the server saw it. The optional
server-read mode of the first-paint branch (`consentCookie`) passes the header along, at the price that mode
already has.
- **Not in the proxy, not in a layout.** Reading the header while rendering a page makes the page dynamic and ends
ISR. Varying a cached page on it needs `Vary: Sec-GPC`, which doubles the variants where the CDN supports `Vary`
and is ignored or refused where it does not (Cloudflare needs a cache rule per header; Google's CDN refuses to
cache such a response). So the rule is: **the server never renders differently for GPC.** A project that does so
in its own code must send `Vary: Sec-GPC` or mark the response private; the docs say so.
- **`/.well-known/gpc.json`.** An exported route handler (`gpcWellKnown()`), added to new sites by the starter. Not
forced into the proxy: a project's matcher usually skips paths with a dot, and a public statement is the site
owner's call.
**Tests** (also §4.6): the store with the signal in every row of the table above; the pre-paint script with and
without the property; `shouldLoadGoogle` with the signal in both modes; no network request to any tracker host with
the signal on; the stale-consent row deletes cookies and sends a Consent Mode update; a browser run with
`Sec-GPC: 1` and the property defined (Chromium through an init script, Firefox through its preference); the built
site keeps `s-maxage` and sends no `Vary` on `Sec-GPC`.
## 3. "Enforced by the plugin"
### 3.1 Three levels
- **Default**: works with no project setting; a project that wants otherwise sets an option (main rule: the opt-out
always exists).
- **Check**: something the plugin cannot decide for a project, reported loudly by `iapl-doctor`, by the browser
check (`iapl-consent-check`), by the crawl, or in the development console.
- **Option**: stays the project's choice.
### 3.2 Defaults
Each item: opt-out, then what changes on the eight live sites after upgrade. "Sites that already set it" see nothing.
**A. GPC honoured** (new). Opt-out: `gpc: false` or `gpc: 'ask'` on `ConsentProvider` / `SiteProviders`.
- Visitor: before → a visitor whose browser sends GPC saw the banner like everyone. After → no banner, cookie
button only; settings window explains.
- Analytics: those visitors can no longer click "Accept all" on a first layer, so fewer of them are measured; in
`advanced` the site also stops sending their cookieless pings. Share of visitors: unknown, today mostly Brave,
DuckDuckGo and Firefox private windows.
- Schema: none.
**B. Nothing to Google before consent** (`consentMode` default `'advanced'` → `'basic'`). Opt-out:
`consentMode: 'advanced'` (and the same value in `cookieScanner.crawl.consentMode`, or the crawl reports Google's
hosts as violations).
- Visitor: no change.
- Analytics: before → Google received cookieless pings from visitors who had not decided or had refused, and could
model them. After → nothing reaches Google until analytics or marketing is granted. GA4's modelling needs about
1,000 denied events a day for a week, Google Ads' own model 700 ad clicks a week per country, so a small site
loses little or nothing; Google Ads then uses its general model.
- Schema: none.
**C. Equal choice** (`equalChoice` default `false` → `true`). Opt-out: `equalChoice={false}` or a `rejectButton`
class.
- Visitor: before → "Reject" was plain text next to a filled "Accept all". After → both are filled buttons of the
same look.
- Analytics: fewer visitors accept. The size cannot be given honestly; published comparisons vary widely.
- Schema: none.
**D. Withdrawal and signals that really work** (fixes, no setting).
- On a category going off: `fbq('consent','revoke')`, `clarity('consent', false)`, `ttq.revokeConsent()` where the
tool is loaded; storage keys of that category from the cookie list are removed like cookies.
- After a tool loads with consent: `clarity('consentv2', …)`; the Consent Mode default is pushed on every site, not
only with GA4 / GTM; `ads_data_redaction` when marketing is denied.
- Visitor: no change. Analytics: Clarity sessions hold together after consent on sites without a Google tag (they
did not before); a visitor who withdraws stops being measured at once, not at the next page.
- Opt-out: `revoke={false}` on `Analytics` for a project that handles it itself. Schema: none.
**E. Consent log** stays an **option** in 1.17.0.
- Turning it on by default adds the `consent-records` collection: a new table on Postgres, so a migration on every
site that never had it. That breaks "no migration in 1.17.0".
- No source requires a per-visitor log (§1.2 row 8). New sites get it from the starter already.
- Instead: doctor warns when the log is off while a tool is configured; the default flips in the first release that
carries a migration anyway (or 2.0).
**F. Default text** (the fallback used when the panel field is empty). Opt-out: the editor's own text in the panel
always wins.
- Visitor: before → "…You can accept all, reject non-essential, or choose which to allow." After → the same plus:
"You can change your choice at any time with the cookie button, and set cookie rules in your browser too." (PL:
"Wybór można zmienić w każdej chwili przyciskiem cookies, a zasady dla plików cookies ustawić także w
przeglądarce.")
- A site with its own text in the panel keeps it; doctor (deep mode) notes when that text has no such sentence.
- Analytics: none. Schema: none (constants in code, no new panel field).
**G. YouTube thumbnail** stays an **option** for existing sites.
- Changing the default (no thumbnail from `i.ytimg.com`) would replace video previews with an empty frame on live
pages. New sites: the block asks for an uploaded poster; `note` gets a default text. Existing sites: the browser
check and the crawl report the request as a warning.
**H. Re-ask period** stays 180 days for consent and refusal; becomes an option (`maxAgeDays`) so a project can
shorten or, with a reason, lengthen it. No change on any site.
### 3.3 Checks that fail loudly
| Check | Where | Severity in 1.17.0 |
|---|---|---|
| `equalChoice={false}`, or `order` without `'reject'` | doctor (layout rule); development console warning from `CookieBanner` | warning |
| `consentMode: 'advanced'` | doctor: info, asks for the decision in `AGENTS.md` → Project decisions | info |
| `gpc: false` | doctor | warning |
| `cookieButton={false}` with no other call to `reopen` | doctor | warning |
| A hand-made banner (no `data-ipal="banner"`) | browser check (exists) | error |
| Consent log off while a tool ID is set | doctor (deep mode reads Site integrations) | warning |
| Privacy policy page not set (banner has no link) | doctor (deep mode) | warning |
| Cookie list empty while a tool ID is set; cookies waiting for approval | doctor (exists for waiting cookies) | warning |
| Crawl `consentMode` differs from the layout's | doctor | warning |
| Tracker request or non-necessary storage before consent, after "Reject", or with GPC | browser check, crawl (`violations.ts`) | error |
| Request to `i.ytimg.com`, `fonts.googleapis.com`, `fonts.gstatic.com`, `maps.googleapis.com` before a choice | browser check, crawl host list | warning |
| "Reject" not equally prominent (§4.4) | browser check | error |
| Withdrawal leaves a listed cookie or key | browser check | error |
Start-up warnings (`onInit`) can only see plugin options, not the layout's props, so the layout checks live in
doctor and in the browser check. Warnings, not errors, in 1.17.0: an upgrade must not turn a green doctor red on a
site whose owner made a choice. Raising some to errors is a 2.0 question.
### 3.4 What stays an option
Banner layout and classes, button order (with the check), `settings` mode, category texts, policy version,
`cookieMap`, `ConsentScript`, `defer`, the consent log and its retention, the scanner and crawl, `consentMode`, the
GPC mode, the `gpc.json` route.
### 3.5 Release shape
- The owner has placed this work in **1.17.0** (a minor, not yet released). Items A, B, C and F change what a site
does after upgrade, which a patch must never do; a minor may, with "what changes on upgrade" at the top of the
changelog and one line of opt-out each.
- Nothing here needs 2.0. Kept for the first release with a migration, or 2.0: the consent log on by default and
its `gpc` / `source` fields, a kept copy of the text shown per policy version, panel fields for the GPC line and
the re-ask period, doctor warnings raised to errors.
## 4. What IAPL and IAWL share: the behaviour spec
Product-neutral. IAWL's five asks (`docs/notes/consent-for-iapl.md` there) are answered in 4.1 to 4.6. The spec
needs no server round trip per page and no per-visitor HTML: a static page plus a decision made in the browser
before the first paint.
### 4.1 Categories and the record (ask 1)
- Categories, fixed names: `necessary` (always on), `functional`, `analytics`, `marketing`.
- Record, JSON: `{ "id": string, "state": { "necessary": true, "functional": bool, "analytics": bool, "marketing":
bool }, "timestamp": ISO 8601 UTC, "version": integer ≥ 1, "gpc": bool }`.
- `id`: 24 hex characters, random, no personal data; the same id in the consent log.
- `version`: the site's policy version; a record with another version counts as no choice.
- `gpc`: the signal's state when the choice was made; absent in records written before this spec.
- A reader ignores unknown fields and treats a non-boolean category as off.
- Consent log entry (optional): `consentId`, `version`, `choices` (the four booleans), creation time. No IP, no user
agent. Later: `gpc`, `source`.
### 4.2 Consent Mode mapping
| Signal | From |
|---|---|
| `ad_storage`, `ad_user_data`, `ad_personalization` | `marketing` |
| `analytics_storage` | `analytics` |
| `functionality_storage`, `personalization_storage` | `functional` |
| `security_storage` | always `granted` |
Default (all optional `denied`, `wait_for_update: 500`) is the first entry, before any tag; an update follows every
choice. Default mode: no Google request before analytics or marketing is granted. Other tools: loaded only with
their category (Clarity: analytics; Meta, LinkedIn, TikTok: marketing), told on grant and on withdrawal where they
have a call for it.
### 4.3 GPC (ask 2)
As §2.3: browser property read before the first paint; header read only by endpoints that are per visitor already;
categories `analytics` and `marketing`; the table of stored choice × signal; modes `honour` / `ask` / off with
`honour` the default; one line of text that says the signal was honoured; nothing stored for a visitor who only
sends the signal; the server never renders a page differently for the signal. In IAWL the opt-out is a code
constant, in IAPL a prop.
### 4.4 Cookie and re-ask period (ask 3)
- Name `cookie-consent`; value: the record, URI-encoded; `Path=/`; `SameSite=Lax`; `Secure` on HTTPS; host-only (no
`Domain`); not `HttpOnly` (the browser script reads it); `Max-Age` 15552000 (180 days), for a grant and a refusal
alike.
- Re-ask: when the cookie is gone, when `version` differs, never otherwise. Reopening is always possible.
- On a category going off: delete that category's cookies (host and parent domains) and storage keys, tell the
tools, write the record.
### 4.5 Equal prominence, in testable terms (ask 4)
On the first layer, at 360×640 and 1280×800:
1. "Accept all" and "Reject" are both `<button>` elements in the same row or stack, both fully visible without
scrolling the banner, one click each completes the choice.
2. Same computed `font-size`, `font-weight`, `padding`, `border-radius` and height.
3. Same computed `background-color`, `color` and border, **or**, where a site styles them apart: text contrast of
each at least 4.5:1, and the contrast of "Reject" against the banner surface not lower than that of "Accept all".
4. "Reject" is not a link, not inside the text, not behind "Settings".
5. Nothing is pre-ticked in the settings view; "Save" there is as prominent as "Accept all" there.
### 4.6 The shared test list (ask 5)
1. First visit, no choice: no tracker request, no non-necessary cookie or key; banner visible at first paint.
2. "Reject": the same as 1 after a reload; record written with all optional off.
3. "Accept all": Consent Mode update `granted`, configured tools start; record written.
4. Settings, one category: only that category's tools start.
5. Reopen and switch a category off: its cookies and keys are gone, tools told, no further request from them.
6. Policy version raised: banner again; old record ignored.
7. Record unreadable or foreign: treated as no choice.
8. GPC on, no choice: no banner (`honour`), no tracker request including Google, cookie button present, the line of
text in the settings window.
9. GPC on, then a grant in settings: tools start; record has `gpc: true`; next visit keeps it.
10. Grant with GPC off, then GPC on: analytics and marketing off, cookies deleted, record rewritten.
11. Equal prominence (4.5).
12. The page HTML is identical with and without the cookie and the signal; cache headers unchanged.
13. No JavaScript: nothing tracks.
## 5. IAB TCF and a Google-certified CMP: not in scope
A site needs them in exactly these cases:
- It **shows ads** through Google AdSense, Ad Manager or AdMob to visitors in the EEA, the UK or Switzerland: Google
serves personalised ads there only with a Google-certified CMP that speaks TCF (since January 2024; TCF 2.3 since
March 2026).
- An advertising partner's contract asks for a TC string (programmatic advertising, header bidding).
A site that only **measures and advertises elsewhere** (GA4, Google Ads conversions and remarketing, Floodlight,
Meta Pixel, Clarity, UET) does not: Google says it does not require advertisers to use a certified CMP, and a site's
own banner with Consent Mode is accepted. If one of the client sites starts selling ad space, that site takes a
certified CMP (`banner={false}`, the plugin keeps the cookie list and the scanner); the plugin does not become one.
## 6. First cut for 1.17.0
Goal: GPC and the enforced defaults, no schema change, the smallest surprise.
**In, no decision needed (no visible change, no schema):** item D (withdrawal and signals), item H (`maxAgeDays`),
the checks of §3.3 as warnings, the `gpc` field in the cookie record, `gpcFromHeaders` and the statistics endpoint
rule, the `gpc.json` route handler (starter only), the browser check's new runs, docs.
**In, each on the owner's yes** (§7 questions 1 to 4): A, B, C, F.
**Out of 1.17.0:** consent log on by default and new log fields (a table / a column); any new field in the Cookie
settings global (a column); the YouTube default; a kept copy of banner texts per version.
**Schema statement.** None of the "in" items adds or changes a collection, a global field, or an import-map entry.
The consent log on by default **would** add the `consent-records` table to every site that has not set
`consentLog`; the variant without a schema change is the one proposed: keep it an option, warn in doctor.
**Fit with the branches going into 1.17.0.**
- `consent-banner-first-paint`: the GPC read goes into `consentBannerScript` (one more condition before paint) and
into `consentStore`'s snapshot; the banner markup stays in everyone's HTML; `s-maxage` and the absence of `Vary`
stay as that branch's e2e asserts. Its early-click replay is unaffected (a `'honour'` visitor has no banner to
click).
- IAWL: §4 is the spec its M3 cites.
## 7. Decisions for the owner
Each is a yes-or-no question with the recommended answer first.
| # | Question | Recommended | Cost of "yes" |
|---|---|---|---|
| 1 | Honour GPC on all sites from 1.17.0: a visitor whose browser sends it gets no banner, analytics and marketing stay off, nothing is sent to Google or any tracker, and they can still opt in from the cookie button? | **Yes, all sites** | Those visitors are measured only if they opt in themselves. Share unknown, small today, will grow in 2027. |
| 2 | Make "nothing to Google before consent" (`consentMode: 'basic'`) the default on all sites, with `'advanced'` as the opt-out? | **Yes, all sites** | No modelled data from visitors without consent; on small sites that is little or nothing. A site that keeps `advanced` sets it in two places. |
| 3 | Make "Reject" look the same as "Accept all" by default on all sites? | **Yes, all sites** | The banner looks different on sites that did not set it; fewer visitors accept, so GA and ad platforms see less. |
| 4 | Add the sentence about changing the choice and browser settings to the default banner text (only where the editor wrote none)? | **Yes, all sites** | One more sentence in the banner on those sites. |
| 5 | Keep the consent log an option in 1.17.0 (doctor warns when it is off), and turn it on by default only in a release that carries a migration? | **Yes** | Sites without the log keep having no server-side record until then; the cookie and the documented versions remain the proof. |
| 6 | Leave the YouTube thumbnail as it is on existing sites (a warning in the checks), and ask for an uploaded poster on new sites? | **Yes** | Existing pages with a video keep one request to Google's image host before any choice. |
| 7 | Doctor reports the new consent checks as warnings in 1.17.0, not errors? | **Yes** | A site can stay on a weaker setting with only a warning. |
| 8 | When GPC appears after an earlier "Accept" (made with the signal off), switch analytics and marketing off without asking? | **Yes** | A visitor who turns the signal on is un-measured at once on every site; it is what the signal says. |
If the owner prefers less change on live sites, the fallback for 1 to 4 is "on for new sites through the starter,
option on existing sites, doctor warns". That keeps every live site as it is and leaves the gap of §1.2 rows 2, 3
and 9 open there.
## 8. Build plan (after the decisions; on top of the first-paint branch)
**Code**
| File | Change |
|---|---|
| `src/modules/consent/gpc.ts` (new) | `GPC_CATEGORIES`, `gpcFromNavigator()`, `gpcFromHeaders()`, `applyGpc(record, signal, mode)` (the table of §2.3, pure), `gpcWellKnown()` route handler. Exported from the root and `/client`. |
| `src/modules/consent/storage.ts` | `gpc` in the record; `serializeConsent` takes it; `CONSENT_MAX_AGE` stays, `maxAgeDays` option reaches the writer. |
| `src/modules/consent/consentStore.ts`, `useConsent.ts` | Signal in the snapshot; effective state; returns `gpc`; the stale-consent rewrite; storage-key clean-up; `onDecision` record carries `gpc`. |
| `src/modules/consent/firstPaint.ts` | Reads `navigator.globalPrivacyControl`; option `gpc`. |
| `src/modules/consent/ConsentContext.tsx`, `frontend/SiteProviders.tsx` | Props `gpc`, `maxAgeDays`. |
| `src/modules/consent/CookieBanner.tsx` | `equalChoice` default `true`; the GPC line; development warning when `order` has no `'reject'`. |
| `src/modules/consent/texts.ts`, `getConsentTexts.ts` | `gpcNotice` with PL / EN defaults; the new sentence in the default message. No new panel field. |
| `src/modules/consent/googleConsent.ts` | `ads_data_redaction`. |
| `src/modules/analytics/Analytics.tsx`, `shouldLoadGoogle.ts`, `pixels.ts` | Default `'basic'`; signal as an input; default pushed on every site; revoke and grant calls; `revoke` prop. |
| `src/modules/stats/endpoint.ts` | The header rule for the visitor id. |
| `src/modules/consent/consentLog.ts` | Body may carry `gpc`; ignored; shape unchanged. |
| `src/modules/consent/scanner/crawl/config.ts`, `violations.ts` | Default mode follows; warning hosts. |
| `src/modules/doctor/rules/` | New consent rules (§3.3), listed in `docs/doctor.md`. |
| `src/modules/starter/` | Default `'basic'`; `gpc.json` route; poster on the video block. |
**Tests**
- Unit (`pnpm test:int`): `applyGpc` table; store and hook with the signal; pre-paint script table next to
`readConsentRecord`; `shouldLoadGoogle`; revoke calls; storage-key clean-up; default texts; doctor rules;
statistics endpoint with the header; consent log body with and without `gpc`.
- Reference e2e (`reference/e2e/smoke.spec.ts`): the shared list of §4.6, with the signal through an init script and
`Sec-GPC: 1`; cache headers unchanged.
- Built site in both bundlers: `pnpm e2e:built` (webpack and Turbopack).
- Old site: `npm_config_loglevel=error pnpm legacy:site`: the unedited 1.16.7 site upgrades with no edit and shows
each "before → after" of §3.2 that the owner accepted.
- `pnpm starter:gate`, `pnpm build:starter`, `pnpm lint`, `pnpm typecheck`.
- Browser check script (`iapl-consent-check/scripts/consent-check.mjs`): runs for GPC, equal prominence, withdrawal.
**Docs** (same change): `docs/consent.md` (GPC section; the line "not needed" removed; defaults), `docs/analytics.md`
(default mode, signals to Clarity / Meta / TikTok), `docs/cookie-scanner.md`, `docs/doctor.md`, `docs/stats.md`,
`docs/agent/AGENT.md`, skills `iapl-consent-check`, `iapl-setup`, `iapl-upgrade`, `iapl-reference` (api.md), the
reference copy through `iapl-skills`, `docs/dev/PROGRAMISTA.md`.
**Changelog, "what changes on upgrade"** at the top of 1.17.0: one line per accepted item of §3.2 in the form
"before → after, opt-out"; "no schema, migration or import-map change"; the note that a site keeping `advanced`
sets the crawl's mode too.
## 9. Sources (looked up 2026-11-26)
**Poland**
- PKE, Dz.U. 2024 poz. 1221, art. 399, 400, 444, 446; consolidated text of 2026-10-16:
https://api.sejm.gov.pl/eli/acts/DU/2024/1221/text/U/D20241221Lj.pdf
- UODO Biuletyn, "Problematyka ochrony danych osobowych a pliki cookies", 2025-03-31:
https://nowybiuletyn.uodo.gov.pl/problematyka-ochrony-danych-osobowych-a-pliki-cookies/
- WSA Warszawa, II SA/Wa 3993/21 (consent through browser settings), as reported:
https://www.prawo.pl/biznes/zgoda-na-cookies-udzielona-przez-ustawienie-przegladarki,512328.html
**EU**
- EDPB, Report of the Cookie Banner Taskforce, 2023-01-17:
https://www.edpb.europa.eu/system/files/2023-01/edpb_20230118_report_cookie_banner_taskforce_en.pdf
- EDPB Guidelines 05/2020 on consent, v1.1:
https://www.edpb.europa.eu/system/files/documents/files/file1/edpb_guidelines_202005_consent_en.pdf
- EDPB Guidelines 2/2023 on the technical scope of art. 5(3), v2.0, 2024-10-07:
https://www.edpb.europa.eu/system/files/2024-10/edpb_guidelines_202302_technical_scope_art_53_eprivacydirective_v2_en_0.pdf
- CJEU C-673/17 *Planet49*, press release: https://curia.europa.eu/jcms/upload/docs/application/pdf/2019-10/cp190125en.pdf
- CNIL, consolidated cookie recommendation (2026-01-16): https://cnil.fr/sites/default/files/2026-01/recommandation_cookies_consolidee.pdf
- DPC Ireland, guidance note on cookies (2020); AEPD, Guía sobre el uso de las cookies (2024):
https://www.aepd.es/guias/guia-cookies.pdf; Garante, Linee guida cookie (2021)
- DSK, Orientierungshilfe Digitale Dienste v1.2 (2024): https://datenschutzkonferenz-online.de/media/oh/OH_Digitale_Dienste.pdf
- Digital Omnibus: Commission proposal COM(2025) 837; Council mandate 14756/26:
https://data.consilium.europa.eu/doc/document/ST-14756-2026-INIT/en/pdf; Parliament file:
https://oeil.europarl.europa.eu/oeil/en/procedure-file?reference=2025/0360(COD)
**Global Privacy Control**
- Specification (W3C Working Draft): https://www.w3.org/TR/gpc/; explainer: https://w3c.github.io/gpc/explainer;
FAQ: https://globalprivacycontrol.org/faq
- MDN, `Sec-GPC`: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-GPC
- California, 11 CCR §7025: https://www.law.cornell.edu/regulations/california/11-CCR-7025
- LG Berlin 16 O 420/19: https://www.vzbv.de/urteile/gericht-untersagt-datenschutzverstoesse-von-linkedin
- Caching: https://developers.cloudflare.com/cache/concepts/vary/, https://nextjs.org/docs/app/guides/cdn-caching
**Vendors**
- Google EU user consent policy and its help page: https://www.google.com/about/company/user-consent-policy/,
https://www.google.com/about/company/user-consent-policy-help/
- Consent Mode: https://developers.google.com/tag-platform/security/concepts/consent-mode,
https://developers.google.com/tag-platform/security/guides/consent, https://support.google.com/analytics/answer/11161109
- Certified CMP requirement: https://support.google.com/admanager/answer/13554116
- Microsoft Clarity: https://learn.microsoft.com/en-us/clarity/setup-and-installation/consent-management,
https://learn.microsoft.com/en-us/clarity/setup-and-installation/clarity-consent-api-v2
- Microsoft UET:
https://about.ads.microsoft.com/en/blog/post/march-2025/providing-user-consent-signals-on-your-microsoft-campaigns-by-may-5-2025
- Meta Business Tools Terms and Pixel consent: https://www.facebook.com/legal/terms/businesstools,
https://developers.facebook.com/docs/meta-pixel/implementation/gdpr
## 10. What could not be verified
- Whether the newest amendment of the PKE (Dz.U. 2026 poz. 1296, 2026-11-06) touches art. 399, 400, 444 or 446; the
consolidated text of 2026-10-16 has them unchanged.
- Any UODO or UKE decision or fine about a cookie banner, and the state of noyb's Polish complaints: none found.
The "UODO requirement" named in `docs/consent.md:393` is, as far as found, the EDPB position repeated in a UODO
article; the docs should say so.
- Any authority's statement that names Google Consent Mode `advanced`. The risk in §1.2 row 2 is a reading of EDPB
2/2023, not a ruling.
- Paragraph numbers in the EDPB documents are accurate to about ±1; *Planet49* paragraph numbers were not checked
against the judgment (the holding is from the Court's press release).
- A measured share of visitors who send GPC; Chrome's and Safari's release dates and defaults; the Zimmeck et al.
paper (read through a summary).
- Microsoft's own UET help text (read through CMP vendors' documentation); whether Meta honours GPC by itself;
TikTok's `revokeConsent` on TikTok's own page.
- That `youtube-nocookie.com` writes to local storage before play (vendor sources only).
- That Safari's 7-day cap on script-written cookies makes the banner return weekly there: not tested. If it does,
the fix is a first-party endpoint that sets the same cookie in a response header; a follow-up, not in the first
cut.
- Nothing was run: no test, no browser, no client site was read. Every line reference comes from reading the code.
- How a project's proxy matcher treats `/.well-known/gpc.json`; to check when building.