Docs: admin languages and texts, wording rule for agents, new screen names

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-27 15:46:25 +01:00
co-authored by Claude Opus 5.5
parent 6b46bc0c14
commit 0a2374db18
45 changed files with 443 additions and 360 deletions
+20 -20
View File
@@ -1,6 +1,6 @@
# cookie scanner
Fills the cookie list (Cookie Settings → Cookies) from the admin panel. A scan lists the cookies of
Fills the cookie list (Cookie banner → Cookie list) from the admin panel. A scan lists the cookies of
every integration the project switches on, plus any extra names, as **drafts** in a review list. An
editor accepts, edits or rejects each one; accepting adds it to the cookie list, which feeds the
`<CookieBanner settings="detailed">` window and `<CookieTable>` on the policy page
@@ -11,7 +11,7 @@ publish anything by itself.
Opt-in (`cookieScanner`, default off). Nothing is fetched at runtime and no browser is needed.
A second, also opt-in step — **Crawl site** (`cookieScanner.crawl`, see [Browser crawl](#browser-crawl)) —
A second, also opt-in step — **Check site** (`cookieScanner.crawl`, see [Browser crawl](#browser-crawl)) —
opens the site in a real browser twice (no consent / after "Accept all") through a shared scanner
service, reports every non-necessary cookie or tracker present before consent as a violation, and adds
what it finds to the same review list. The browser runs in the service, never in the site.
@@ -33,7 +33,7 @@ Then, in the project:
2. **Postgres / SQLite migration** — the option adds the `cookie-review` collection (with localized
`purpose` and `retention`). Run `pnpm payload migrate:create cookie-scanner`, commit the migration;
Coolify runs `payload migrate` on deploy (deployment.md). MongoDB: nothing to do.
3. **Verify** — log in as an editor, open *Settings → Cookie review*. The box lists "Integrations in
3. **Verify** — log in as an editor, open *Privacy → Cookie review*. The box lists "Integrations in
use" (e.g. Cookie banner, Admin panel login, Google Analytics 4). Click **Scan cookies**: drafts
appear, each with *Found by* = Plugin integration. Set one to *Accepted*, save, open *Cookie
Settings → Cookies*: the cookie is there, with purpose and retention in every language.
@@ -42,11 +42,11 @@ Then, in the project:
| Step | What happens |
|---|---|
| **Scan cookies** | One draft per cookie of the integrations in use. Cookies already in Cookie Settings → Cookies are looked up too (*In the cookie list* is ticked). |
| **Scan cookies** | One draft per cookie of the integrations in use. Cookies already in Cookie banner → Cookie list are looked up too (*In the cookie list* is ticked). |
| **More cookie names** (optional text box) | Names seen in the browser (DevTools → Application → Cookies), one per line. Each is looked up in the project's declarations, every built-in integration, then the Open Cookie Database. A name nothing knows becomes an entry with *Found by* = "Unknown — fill in" and no category. |
| Edit a draft | Change provider, category, purpose, retention. A later scan keeps every value you changed (per language) and still updates values you left as suggested. |
| **Accepted** | The cookie is added to Cookie Settings → Cookies in every language. When a row with that name already exists, only its empty provider / purpose / retention are filled — text written there stays, its category is not changed. An entry without a category cannot be accepted. |
| **Rejected** | Stays in the list as rejected; later scans do not bring it back to draft. Rejecting never removes a row from Cookie Settings — delete it there. |
| **Accepted** | The cookie is added to Cookie banner → Cookie list in every language. When a row with that name already exists, only its empty provider / purpose / retention are filled — text written there stays, its category is not changed. An entry without a category cannot be accepted. |
| **Rejected** | Stays in the list as rejected; later scans do not bring it back to draft. Rejecting never removes a row from Cookie banner — delete it there. |
Status changes work in the list's bulk edit too. Deleting review entries is admin-only and never done
by the plugin.
@@ -67,8 +67,8 @@ integrations switched on in this project are part of a scan:
| Admin panel login | always | `payload-token` (`<cookiePrefix>-token`, necessary, editors only) |
| Language choice | more than one locale in `i18n` | `NEXT_LOCALE` (functional, session) |
| Built-in statistics | `stats` option | `ipal_vid` (analytics, 6 months) |
| Google Analytics 4 | GA4 ID in Site Integrations | `_ga`, `_ga_*` (analytics, 2 years) |
| Google Tag Manager | GTM ID in Site Integrations | `_gcl_*` (marketing — the Conversion Linker; other tags in the container: add their names or declare them) |
| Google Analytics 4 | GA4 ID in Site integrations | `_ga`, `_ga_*` (analytics, 2 years) |
| Google Tag Manager | GTM ID in Site integrations | `_gcl_*` (marketing — the Conversion Linker; other tags in the container: add their names or declare them) |
| Meta Pixel | Pixel ID | `_fbp`, `_fbc` (marketing, 3 months) |
| Microsoft Clarity | Clarity ID | `_clck`, `_clsk`, `CLID`, `MUID` |
| LinkedIn Insight Tag | partner ID | `li_fat_id`, `bcookie`, `lidc`, `UserMatchHistory` |
@@ -126,7 +126,7 @@ run the tests, commit.
| `access` | editor and up | `({ req }) => boolean` — who may scan, start a crawl and read its status |
| `collectionOverrides` | — | Change `cookie-review`: an object merges `access` / `admin` / `hooks` key by key (your keys win), a function takes over (keep the slug) |
| `labels` | `en`, `pl` | `{ de: { scanButton: 'Cookies scannen', … } }` — merged over the plugin's labels (`CookieScanLabels`) |
| `syncAccepted` | `true` | `false` = accepting only marks the entry; nothing is written to Cookie Settings |
| `syncAccepted` | `true` | `false` = accepting only marks the entry; nothing is written to Cookie banner |
| `crawl` | off | browser crawl through the scanner service — [Browser crawl](#browser-crawl) |
A project declaration:
@@ -162,7 +162,7 @@ const chat: CookieIntegration = {
ipalKit({ cookieScanner: { integrations: (defaults) => [...defaults, chat] } })
```
`ctx` (`CookieScanContext`) has `payload`, `integrations` (the Site Integrations global, depth 0) and
`ctx` (`CookieScanContext`) has `payload`, `integrations` (the Site integrations global, depth 0) and
`plugin` (`{ localeCount, stats }`).
## Endpoint
@@ -202,7 +202,7 @@ All from `@intecion/ipal-kit` (server-safe), for your own admin view, a CLI or a
| `DEFAULT_COOKIE_INTEGRATIONS`, `DEFAULT_DATABASE_CATEGORIES`, `cookieNameMatches(pattern, name)` | declarations and matching |
| `buildCookieReviewCollection(options)`, `buildCookieScanEndpoints(options, plugin)` | the collection and endpoints, to wire by hand |
| `COOKIE_SCAN_LABELS`, `mergeCookieScanLabels(overrides)` | admin labels |
| `CookieScanButton` (`/admin`) | the box above the list (with **Crawl site** when `crawl` is on) |
| `CookieScanButton` (`/admin`) | the box above the list (with **Check site** when `crawl` is on) |
| `CookieCrawlAlert` (`/admin`) | the dashboard warning (injected with `crawl`) |
| `buildCookieCrawlGlobal(labels)`, `buildCookieCrawlEndpoints({ labels, options, plugin })` | the crawl's global and endpoints, to wire by hand |
| `resolveCrawlConfig(crawlOptions, payload)` | options + env + `serverURL` → `ResolvedCrawlConfig` (what is missing) |
@@ -222,18 +222,18 @@ Types: `CookieDeclaration`, `CookieIntegration`, `CookieScanContext`, `CookieFin
## Browser crawl
What a page really sets — a GTM tag, an iframe, a script pasted into a block — shows only in a
browser. `cookieScanner.crawl` adds **Crawl site** to the *Cookie review* box. One shared **scanner
browser. `cookieScanner.crawl` adds **Check site** to the *Cookie review* box. One shared **scanner
service** (`services/cookie-crawler` in the ipal-kit repository, run by the team on Coolify) does the
browsing for every site:
```
editor ── Crawl site ──▶ site POST /api/ipal/cookie-crawl
editor ── Check site ──▶ site POST /api/ipal/cookie-crawl
site ── POST {IPAL_COOKIE_SCAN_URL}/crawl (Bearer token) ──▶ scanner service
crawls the sitemap pages twice:
1. fresh profile, no decision
2. fresh profile, clicks "Accept all"
site POST /api/ipal/cookie-crawl/results (Bearer token) ◀── cookies, storage keys, third-party hosts
→ drafts in Cookie review, violations, Cookie crawl global, dashboard warning, e-mail
→ drafts in Cookie review, violations, Cookie check global (`cookie-crawl`), dashboard warning, e-mail
```
### Turn it on in a site
@@ -258,9 +258,9 @@ ipalKit({
`cookie-review` (`violation`, `violationDetail`, `seenBeforeConsent`):
`pnpm payload migrate:create cookie-crawl`, commit; Coolify runs `payload migrate` on deploy.
4. **Service:** add the site to the service's `IPAL_CRAWLER_SITES` (below) and redeploy the service.
5. **Verify:** *Cookie review* shows "Crawl site" enabled (when disabled, the box names the missing env
5. **Verify:** *Cookie review* shows "Check site" enabled (when disabled, the box names the missing env
var). Click it: the status says "Crawling…", then after one to a few minutes "Last crawl …: N pages,
N violations, N new unknown" and the list reloads. *Settings → Cookie crawl* shows the latest
N violations, N new unknown" and the list reloads. *Privacy → Cookie check* shows the latest
result. A test: put a `<script>document.cookie='_fbp=x'</script>` in a block on a staging page →
the next crawl reports `_fbp` as a violation and the dashboard shows the warning.
@@ -274,10 +274,10 @@ ipalKit({
| Violation (cookie or key) | seen **before consent** and its review entry's category is not `necessary` — an entry without a category counts too, until an editor classifies it |
| Violation (request) | a request **before consent** to a tracker host (`DEFAULT_TRACKER_HOSTS`: Meta, LinkedIn, TikTok, Clarity, Bing, Hotjar, YouTube). Google's tag hosts (`GOOGLE_TAG_HOSTS`) count only with `consentMode: 'basic'` — in `advanced` (the plugin's default) the Google tag may load before consent with every signal denied |
| Review entries | `seenBeforeConsent`, `violation` and `violationDetail` ("before consent on /, /about") — from the **latest crawl only**: every crawl clears the previous flags |
| Cookie crawl global | latest result only (no history): status, started / finished, by whom, pages, counts, violations, third-party hosts, error |
| Cookie check global (`cookie-crawl`) | latest result only (no history): status, started / finished, by whom, pages, counts, violations, third-party hosts, error |
| "Accept all" not found | the second run had no consent — the global's error says so (`crawl.acceptSelector` for a custom banner) |
| Dashboard | a warning above the dashboard after a crawl with violations or new unknown cookies, or a failed crawl (`crawl.dashboard: false` turns it off) |
| E-mail | opt-in per site: *Settings → Cookie crawl → E-mail warnings to* (admin; comma-separated). Sent after a crawl with violations or new unknown cookies, through the project's Payload email adapter (`email: mailAdapter()`, email.md). Empty = no e-mail |
| E-mail | opt-in per site: *Privacy → Cookie check → E-mail warnings to* (admin; comma-separated). Sent after a crawl with violations or new unknown cookies, through the project's Payload email adapter (`email: mailAdapter()`, email.md). Empty = no e-mail |
A crawl still "running" after 30 minutes counts as failed (the service never reported back), and a new
one may start. One crawl per site at a time (`409` otherwise).
@@ -379,7 +379,7 @@ open proxy), runs Chromium as the image's non-root user, and keeps nothing after
The same crawl, without the service: `cd services/cookie-crawler && npm install && npx playwright
install chromium`, then `node cli.mjs https://acme.pl --pages 10` prints the result as JSON (exit code
1 when anything but the consent cookie is stored before consent). It does not know the site's
categories — the panel's **Crawl site** gives the verdict. `ipal-consent-check` → cookie-scan
categories — the panel's **Check site** gives the verdict. `ipal-consent-check` → cookie-scan
(`cookie-scan.mjs`) stays the quick check for projects without the service; paste the names it reports
as unknown into **More cookie names**.
@@ -388,7 +388,7 @@ as unknown into **More cookie names**.
- **Turn off the crawl only:** omit `crawl` (default) — no `cookie-crawl` global, no crawl endpoints, no
dashboard warning, no violation fields; `dashboard: false` keeps the crawl without the warning.
- **Turn off:** omit `cookieScanner` (default). Turning it off later keeps no endpoint and no
collection; Cookie Settings → Cookies keeps every row (it is still edited by hand or by the skill's
collection; Cookie banner → Cookie list keeps every row (it is still edited by hand or by the skill's
import script).
- **Override:** `collectionOverrides` (access, admin, hooks), `access` (who scans), `labels`,
`databaseCategories`, `integrations` (change or drop a built-in), `syncAccepted: false`; for the