- Theme choice in localStorage under 'theme' (next-themes' key and values)
instead of 'ipal-theme'. ThemeScript moves an old choice before the first
paint and removes the old key; useTheme / ThemeSwitcher do the same
without the script. ipalKit({ theme: { storageKey } }) sets an own key,
which reaches ThemeScript through getSiteShell().theme and <html
data-theme-storage>.
- The cookie scanner declares the theme key (Theme choice: local storage,
necessary, until changed or site data is cleared) when the theme switch
is on, so Scan cookies finds it without a crawl.
- Cookies -> Cookie list rows get a Type (cookie / local storage / session
storage, default cookie, shared by every language), filled by scan, review
and approval. The detailed settings window and <CookieTable> show it with
English and Polish defaults; the approval page marks storage entries.
- Migration: adds cookie_settings_cookies.storage (DEFAULT 'cookie') and
cookie_settings_locales.detail_labels_storage, nothing else.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
9.6 KiB
name, description
| name | description |
|---|---|
| ipal-consent-check | Proves in a real browser (Playwright) that an ipal-kit site respects cookie consent — no Meta/Clarity/LinkedIn/TikTok/Ads requests and no tracking cookies before a decision or after "reject", Google only with Consent Mode "denied" signals, tags starting after "accept". Use after adding analytics, pixels, embeds (YouTube, maps, chat) or third-party scripts, before handing a site over, and whenever GDPR/RODO or cookie banner behaviour is in question. |
ipal-consent-check
GDPR: non-Google tags load only after consent; Google (GA4/GTM) may
load earlier only with the Consent Mode "denied" signal and without cookies.
That early load happens only in Consent Mode advanced (the default); with
<SiteProviders analytics={{ consentMode: 'basic' }}> no request goes to googletagmanager.com
before analytics or marketing consent — check the project's choice in "Project decisions".
Steps
- Once per project:
pnpm add -D playwright && pnpm exec playwright install chromium - Start the app (
pnpm build && pnpm start) and check a page with tags (ideally the homepage and a page with a form/video):node .agents/skills/ipal-consent-check/scripts/consent-check.mjs http://localhost:3000/pl--wait 6000when tags start slowly (defermode in Analytics). - Output: three runs in clean profiles — no decision, "Accept",
"Reject" + reload. Every
[ERROR]is a violation — fix it:
| Violation | Cause → fix |
|---|---|
| pixel loaded without consent | script wired by hand / copied Analytics → ID in Site integrations, <Analytics> from the plugin (analytics.md) |
| tracking cookie set without consent | same; or GTM fires a tag without an ad_storage condition (analytics.md → GTM) |
| GA hit with consent GRANTED | setDefaultConsent not before the tag — <Analytics> must be inside <ConsentProvider> (SiteProviders does this itself) |
| YouTube / Maps before consent (warning) | ConsentScript (consent.md), youtube-nocookie.com or "click to load" |
- The "after accept" section shows what starts after consent — compare it with the IDs in Site Integrations (e.g. is Meta Pixel there, if the client has one). Nothing starts but IDs are filled in → report it as a problem to diagnose (ipal-debug).
- Banner not found (
data-ipal="banner") →<CookieBanner/>is not rendered, or an older ipal-kit version withoutdata-ipalattributes on the buttons → ipal-upgrade.
The script needs buttons with data-ipal="accept" / "reject" — the plugin's
CookieBanner has them in every settings mode (inline, modal, detailed). A custom banner in the project violates AGENT.md §7.
Cookie list from the panel (cookieScanner)
When the project has ipalKit({ cookieScanner: true }) (cookie-scanner.md), the editor fills the
list in the panel and you check it:
- Not on yet → turn it on,
pnpm generate:importmap,pnpm payload migrate:create cookie-scanner(Postgres), commit the migration. Embeds and widgets the plugin does not inject (YouTube, maps, chat): add them ascookieScanner.declarations(or anintegrationsentry withisEnabled) — never a hand-typed list in code. - Privacy → Cookies → Review and approve → Scan cookies (with
adminLayout: 'separate': Privacy → Cookie review). "Integrations in use" must match the IDs in Site Integrations; a filled ID that is missing → ipal-debug. - Run the browser scan below and paste every cookie it reports as unknown into More cookie names, scan again. Cookies marked Needs description need provider, category and purpose: ask the client, do not guess (Edit on the approval page opens the entry).
- Approve in the same tab (also at
/admin/cookie-approval): the cookies are grouped by category, new / changed / needs-description marked. Untick anything that should not be listed, then Approve and add — every ticked cookie goes to Cookies → Cookie list in every language (and so to the cookie policy table and the banner's detailed window); existing text is never overwritten, no row is duplicated. Unknown cookies land inmarketing(orapproval.unknownCategory) flagged "Needs description" — describe them before handover. Open the banner's "Settings" and check each category lists its cookies. A project withapproval: falseaccepts entry by entry (Status → Accepted, bulk edit works). - No longer found on the approval page = a cookie a scan stopped seeing; it stays in the cookie list. Remove the row there only when the site really no longer sets it.
- Database lookups come with category
functionalwhen the Open Cookie Database says "Functional" (it files some trackers there) — lower tonecessaryonly when the cookie really is needed for the site to work.
Pre-consent check from the panel (cookieScanner.crawl)
When the project has cookieScanner: { crawl: true } (cookie-scanner.md → Browser crawl):
- Not on yet and the client wants it → turn it on; env
IPAL_COOKIE_SCAN_URL+IPAL_COOKIE_SCAN_TOKEN(openssl rand -hex 32) in Coolify; ask the team to add<host>=<token>to the scanner service'sIPAL_CRAWLER_SITES;generate:importmap,migrate:create cookie-crawl. Never add Playwright or Chromium to the site. - Cookie review → Check site. "Check site" disabled → the box names the missing variable. Failed → Privacy → Cookie check → Error ("Could not reach the scanner service" = URL / DNS / firewall; a Cloudflare challenge page = allow the Coolify server's IP).
- Filter the list by Violation: every entry is a non-necessary cookie or key stored before consent — fix it as in the table above (or, if it really is necessary, set its category and accept it). Cookie check → Violations also lists tracker requests before consent.
- Describe the cookies marked Needs description, approve on Approve cookies (the dashboard links there while cookies wait), then crawl again: 0 violations and nothing waiting is the goal before handover. A crawl never adds anything to the cookie banner by itself.
- Optional: recipients in Cookie check → Warning e-mails to (the e-mail also says when cookies
wait for approval and links to the approval page), and a weekly Coolify scheduled task
curl -X POST -H "Authorization: Bearer $IPAL_COOKIE_SCAN_TOKEN" $NEXT_PUBLIC_SERVER_URL/api/ipal/cookie-crawl. Record both inAGENTS.md→ "Project decisions".
Cookie list for the cookie policy (cookie-scan)
After every change of tools (new pixel, chat, map, video) and before handing the site over
(with cookieScanner on, use step 1 below to find what really appears in the browser, then feed the
unknown names to the panel scan above instead of step 2):
- Scan the running site (without consent and after "Accept all", homepage + up to 10 pages from the sitemap):
Output:
node .agents/skills/ipal-consent-check/scripts/cookie-scan.mjs http://localhost:3000 --lang plcookie-scan/cookies.jsonandcookie-scan/cookies.md(table).[ERROR]= a non-necessary cookie set before consent — fix it as in the table above.[WARNING] unknown— find the provider and purpose, setcategory(necessary|functional|analytics|marketing) andpurposeincookies.json. Do not guess — ask if you do not know. - Import into the panel (Cookies → Cookie list), each language separately (scan with
--lang enfor English):It merges by name and does not overwrite editor changes (LOCALE=pl pnpm payload run .agents/skills/ipal-consent-check/scripts/import-cookies.ts cookie-scan/cookies.jsonOVERWRITE=1forces it). It does not delete cookies the scan did not see — the editor does that in the panel. The same list feeds the<CookieBanner settings="detailed">window (an expandable list under each category) — after the import open "Settings" in the banner and check that every category shows its cookies and that the labels (Cookies → Settings window → Cookie list headings) are in that language. - The cookie policy page shows the table from the panel — do not paste the list into the policy text:
import { getCookieTable } from '@intecion/ipal-kit' import { CookieTable } from '@intecion/ipal-kit/rsc' import { getCachedPayload, getSiteShell } from '@/lib/content' const rows = await getCookieTable({ payload: await getCachedPayload(), locale }) const { consent } = await getSiteShell(locale) // category names from Cookie banner <CookieTable rows={rows} categories={consent.categories} labels={labels} />labels={ name, category, provider, purpose, duration }(all required). The plugin panel has onlyprovider/purpose/duration(Cookies → Settings window → Cookie list headings =consent.details); take thenameandcategoryheaders from (localized) fields of the project block. The table is unstyled (classNames:table,caption,tr,th,td; optionalcaption). A project "Cookie table" block on the policy page is a good place — then the editor decides where it appears.
Lifetime: Chrome caps every cookie at max. 400 days (13 months) — the scan shows what
really stays in the browser. localStorage keys (e.g. theme — the chosen theme) are listed separately; in the panel they are entries of type Local storage (the scanner declares the theme key itself when the theme switch is on). Check that every storage row in Cookies → Cookie list has the right Type — rows from before the type existed are Cookie.