Per-vendor checklists for switching to Cookyay. Each checklist walks you through removing the old CMP, remapping categories, running the scanner, and updating your CSP — in the right order.
cookieyes-consent,
CookieConsent, or an OneTrust GUID cookie). Cookyay stores consent in
cookyay_consent. Existing visitors have no
cookyay_consent cookie, so Cookyay will show them the banner again — even if
they previously accepted all cookies. This is legally correct (you are changing the tool
that processes their consent) but may spike your consent-rate metrics temporarily. To make
the re-prompt intentional rather than accidental, bump your policyVersion
when you go live.
policyVersion controls future re-prompts.
Cookyay stores policyVersion in the visitor's consent record and re-shows the
banner whenever the stored version differs from the one in your config. Set
policyVersion to today's date (e.g. '2026-06-14') when you
migrate. The next time you change your cookie policy, bump the date — all returning
visitors will be re-prompted automatically.
<head>.
The inline bootstrap snippet fires Google Consent Mode v2 defaults (all denied) and arms
the script-intercept proxy before any other script runs. Any tracker placed
before the bootstrap in your HTML will escape interception — the browser has
already dispatched its request. If your CMS or tag manager injects scripts at the very top
of <head> unconditionally, declarative blocking (rather than
autoBlock) is the safer approach for those scripts.
<noscript> pixel fallbacks.
Many vendor-provided snippets (Meta Pixel, Google Ads) include a
<noscript><img src="..."></noscript> fallback. These bypass
script blocking entirely — the browser loads the pixel even with JavaScript disabled and
even before consent. Remove all such tags from your HTML when you migrate.
OneTrust is the most complex of the three vendors covered here. It uses a richer, hierarchical taxonomy with "purposes" and "stacks" on top of categories. The migration requires more manual mapping, but the end state is simpler — Cookyay's four-category model covers the essentials, and the scanner fills in the gaps.
OneTrust uses "purposes" and custom category groups. The mapping below covers the most common OneTrust default category names. Your OneTrust configuration may use custom names — check your OneTrust dashboard under Cookie Categories and map each to the closest Cookyay equivalent.
| OneTrust category (common defaults) | Cookyay category | Notes |
|---|---|---|
| Strictly Necessary Cookies | necessary |
Always-on. Cannot be opted out of in either tool. |
| Functional Cookies / Performance Cookies (some OneTrust templates) | functional |
Language/region preferences, live chat, saved form state. "Performance" in some
OneTrust configs means site-performance analytics (e.g. Core Web Vitals tooling) —
those map to analytics instead.
|
| Performance Cookies / Analytics Cookies | analytics |
GA4, Hotjar, Heap, Amplitude, Mixpanel, Segment (analytics events). When OneTrust
uses "Performance" for analytics (common on pre-GDPR configs), map it to
analytics.
|
| Targeting Cookies / Advertising Cookies / Social Media Cookies | marketing |
Meta Pixel, Google Ads, LinkedIn Insight, Twitter/X Ads, TikTok Pixel. OneTrust often groups social sharing pixels here too. |
Before you start: In the OneTrust dashboard, export your cookie list (go
to Cookies → Export). The export includes cookie name, domain, category, and
purpose. Use this list — combined with the scanner output — to build your Cookyay
categories config.
Delete the OneTrust CDN script tag (cdn.cookielaw.org/consent/<domain-id>/OtAutoBlock.js
and cdn.cookielaw.org/scripttemplates/otSDKStub.js). Also remove
OneTrust's auto-blocker script (OtAutoBlock.js) if present, and any
OneTrustActiveGroups, OptanonWrapper, or
OneTrust.OnConsentChanged callback bindings in your code.
data-category / group-ID attributes.
OneTrust's auto-blocker marks scripts with group IDs like
data-category="C0002" or wraps them in conditional blocks referencing
OneTrustActiveGroups. Replace these with Cookyay's blocking pattern:
<!-- Before (OneTrust auto-block) -->
<script type="text/plain" class="optanon-category-C0003"
src="https://example.com/analytics.js"></script>
<!-- After (Cookyay) -->
<script type="text/plain" data-category="analytics"
data-src="https://example.com/analytics.js"></script>
OneTrust group IDs map to Cookyay categories as follows:
C0001 (Strictly Necessary) → omit blocking (always runs),
C0002 (Performance/Analytics) → analytics,
C0003 (Functional) → functional,
C0004 (Targeting) → marketing, C0005 (Social
Media) → marketing. Custom groups: check your OneTrust dashboard and
map manually.
<noscript> pixel fallbacks.
Search for and delete all <noscript><img> pixel tags.
Using your OneTrust export and the category mapping above, build the Cookyay
categories block. Run the scanner to catch
cookies the export might have missed (Hotjar session cookies, marketing pixels,
etc.).
<head>.
The bootstrap must be the very first <script> in
<head>. See Quickstart.
See CSP update below.
OptanonAlertBoxClosed and OptanonConsent. Cookyay uses
cookyay_consent. All returning visitors will be re-prompted on their first
visit after the migration.
The @cookyay/scanner CLI crawls your site locally using a headless browser,
detects cookies and third-party requests, classifies ~60 known services (GA4, Meta Pixel,
Hotjar, Intercom, Stripe, Sentry, PostHog, and more), and emits a ready-to-use
cookyay.config.json. This is the one migration step that can be automated —
the config import itself is not feasible (vendor formats are undocumented and brittle),
but the scanner fills in the same information from first principles.
# First run downloads Chromium (~150 MB) — subsequent runs are fast
npx @cookyay/scanner scan https://yoursite.com --config-out cookyay.config.json
The scanner runs on your machine — nothing leaves your network. It can scan
localhost and pages behind authentication (pass
--cookies session.json with a Playwright cookie file). The emitted
cookyay.config.json includes a categories block with services
grouped by detected category and a suggestedBlocking array of paste-ready
HTML snippets for declarative blocking.
The scanner outputs a JSON file. Copy the categories block into your
Cookyay.init() config. The suggestedBlocking array gives you
<script type="text/plain"> snippets to paste into your HTML for
declarative blocking of detected services.
Review and adjust: the scanner classifies cookies and requests by
matching against its curated database. It annotates each detection with a
confidence level ("high" = two independent signals agree;
"medium" = one signal). Review low-confidence entries before shipping — a
session cookie from your own server may be misclassified if it shares a name pattern with
a known tracker.
Scanner vs autoBlock: both approaches are valid and complementary.
Declarative blocking (paste the scanner's suggested snippets into HTML) requires a
one-time HTML edit per tracked service but is the most explicit approach.
autoBlock: true intercepts known third-party requests at runtime without HTML
changes — enable it in config and the same signature database that powers the scanner
handles interception at runtime. You can use both: declarative for services outside the
curated database, autoBlock: true for the rest.
If your site uses a Content-Security-Policy header (or
<meta http-equiv="Content-Security-Policy">), you need to update it
after migrating.
Remove the old CMP's CDN domains from your CSP script-src and
connect-src directives:
cdn-cookieyes.com,
log.cookieyes.com
consent.cookiebot.com,
consentcdn.cookiebot.com
cdn.cookielaw.org,
geolocation.onetrust.com
Cookyay loads its UI bundle from the URL you choose (your own server or a CDN). If you serve from jsDelivr:
cdn.jsdelivr.net to script-src. Better: pin to an exact
version with SRI and use 'sha384-...' instead of the hostname — SRI hashes
are more secure than allowlisting a CDN domain.
If you enable the optional consent webhook (consent.webhook: 'https://your-endpoint'):
connect-src. Cookyay fires the
webhook via fetch({keepalive:true}) — it does not use
sendBeacon (to avoid self-interception). The webhook is opt-in and off by
default; if you do not set consent.webhook, no CSP
connect-src change is needed for Cookyay itself.
'unsafe-inline' or a hash
Cookyay's bootstrap is a synchronous inline <script> tag — it cannot be
an external file (it must block rendering to fire Consent Mode defaults before GTM loads).
If your CSP restricts script-src:
'sha256-...' hash of the
bootstrap snippet text to script-src. The hash changes whenever the
bootstrap changes (i.e., on Cookyay version bumps — not on every deploy). Use
openssl dgst -sha256 -binary dist/bootstrap.js | openssl base64 to compute
it, or copy it from the release notes.
nonce="..." to the bootstrap <script> tag and include
that nonce in script-src.
After deploying, run through this checklist in the browser to confirm the migration is working correctly. Use a fresh browser profile (no prior consent cookie) and one with a returning-visitor cookie from the old CMP.
debug: true in config)cookyay_consent cookie, the banner should show on
first load. This is expected — the consent cookie name changed.
<noscript> pixel requests: confirm that no pixel
or beacon URLs fire before the user consents (these should have been removed in step 2
of the checklist).
Re-run npx @cookyay/scanner scan https://yoursite.com after going live to
verify the scanner sees the correct set of services and all high-confidence detections are
already declared in your config.
debug: true
Once you are confident the migration is working, remove debug: true (or set
it to false) from your production config. Debug mode emits verbose console
output that is useful during development but noisy in production.