Your cookie banner says "Reject". Here's how to check if anything listens
When we loaded 876 websites from 14 EU countries without touching the cookie banner, 55 % of them had already sent requests to analytics or advertising services. Most of those sites had a perfectly normal-looking banner.
When we loaded 876 websites from 14 EU countries without touching the
cookie banner, 55 % of them had already sent requests to analytics or
advertising services. Most of those sites had a perfectly normal-looking
banner. The banner was there; it just wasn't connected to everything it
was supposed to hold back.
You can't see that by looking at the page. You can see it in about five
minutes in the network tab, and if you want to repeat it after every
deploy, in about 40 lines of Playwright. Both below.
The manual check (5 minutes)
- Open a private window. An old consent cookie hides everything.
- Disable ad blockers and privacy extensions for this test. They block the very requests you're looking for.
- Open DevTools (F12) before you load the page. In the Network tab, tick "Preserve log" and "Disable cache".
- Load the site and don't touch the banner.
- Filter for the usual suspects:
google-analytics,googletagmanager,doubleclick,facebook,clarity.ms,hotjar,tiktok,linkedin,fonts.googleapis. In Chrome, the "3rd-party requests" filter helps you spot the ones you didn't expect. - Check Application → Cookies and Local Storage.
_ga,_gcl_au,_fbp,_hj*before any click is a red flag. - Now click "Reject", reload, and open a second page. Do the same filters again.
That second pass matters more than people think. Many setups behave on
the first page view and leak on the second, or ignore "Reject" because
the tag fires on "All pages" instead of on the consent event.
One Google-specific detail: in Consent Mode "advanced", Google tags load
before consent and send pings with gcs=G100 (denied). That's how the
mode is designed. If you want zero requests to Google before consent,
you need "basic" mode, where the tags don't load at all until someone
agrees.
Where the leaks usually come from
From what we saw across those 876 sites, it's rarely the banner itself:
- Scripts pasted into the theme header (pixel snippets, "header scripts" fields in the theme settings). They run before any consent tool gets a say.
- Tag Manager triggers set to "All Pages" without a consent condition.
- Plugins and apps that inject their own tracking, especially on WordPress and Shopify.
- Embeds: YouTube, Vimeo, Google Maps without a click-to-load placeholder.
- Google Fonts from Google's servers. 57 % of the sites loaded them before consent, usually through the theme or a page builder, not because anyone added them on purpose. Each request sends the visitor's IP to Google.
When something shows up early, the Initiator column in the network tab
tells you which file loaded it. That's usually the fastest way to the
plugin or snippet responsible.
Automating it with Playwright
Doing the manual check once is fine. Doing it after every plugin update
is where it falls apart. Here's a minimal script that loads a page in a
fresh context, records third-party requests before any click, clicks a
reject button, and records again:
import { chromium } from "playwright";
const url = process.argv[2];
const host = new URL(url).hostname.replace(/^www\./, "");
const TRACKERS = /google-analytics|googletagmanager|doubleclick|facebook|clarity\.ms|hotjar|tiktok|linkedin|fonts\.googleapis/;
const thirdParty = (reqs) =>
[...new Set(reqs.map((r) => new URL(r).hostname))]
.filter((h) => !h.endsWith(host));
const browser = await chromium.launch();
const context = await browser.newContext(); // fresh: no consent cookie
const page = await context.newPage();
let seen = [];
page.on("request", (r) => seen.push(r.url()));
await page.goto(url, { waitUntil: "networkidle" });
const before = thirdParty(seen);
// Common wording; extend for your banner and language.
const reject = page.getByRole("button", { name: /reject|decline|deny|only necessary|ablehnen/i }).first();
if (await reject.isVisible().catch(() => false)) {
await reject.click();
seen = [];
await page.reload({ waitUntil: "networkidle" });
} else {
console.log("No reject button found on the first layer.");
}
const after = thirdParty(seen);
console.log("Before consent:", before.filter((h) => TRACKERS.test(h)));
console.log("After reject: ", after.filter((h) => TRACKERS.test(h)));
await browser.close();
Run it with node check.mjs https://your-site.example. Two empty lists
is what you want. A non-empty "before" list means something loads ahead
of the banner; a non-empty "after" list means "Reject" isn't wired to it.
Limits worth knowing:
- The regex is a starting point, not a tracker database. Print the full
beforelist once and look at every host you don't recognise. - Banners differ. Some put "Reject" behind "Settings", some use links instead of buttons, some live in an iframe. If the script says it found no reject button, look at the banner by hand: a missing reject option on the first layer is a finding in itself (43 % of the banners in our sample had none).
- Bot protection can serve a different page to headless browsers. If results look odd, compare with a normal browser before trusting them.
- Server-side tracking doesn't show up in the browser at all.
What I ended up building
I kept running variations of that script on more and more sites, and it
grew into a scanner that does the full version: it checks several pages,
finds the reject button in the usual banner tools, confirms suspicious
results with an ordinary browser, and names the file that loaded each
service plus the setting to change in your consent tool. The first
report is free and needs no sign-up, if you want to compare it with what
your own script finds:
https://konformia.at/en?q=devto-blocking
The study with method and limits is here:
https://konformia.at/en/cookie-study?q=devto-blocking
If your banner breaks the script in an interesting way, tell me in the
comments. Those are the cases I learn the most from.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.