You are offline

Switched to Home view. Returning to your route when internet connects.

← Back to Knowledge Center
Coding
Published:Nov 28, 2026
•
Updated:Nov 28, 2026
•5 min read

Your cookie banner says "Reject". Here's how to check if anything listens

Your cookie banner says "Reject". Here's how to check if anything listens
Karan Singh

Karan Singh

Contributor & Platform Mentor

Writes about programming, productivity, and online learning.

Tbh, this is something I struggled with for a while, so I hope it helps someone.

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)
  1. Open a private window. An old consent cookie hides everything.
  2. Disable ad blockers and privacy extensions for this test. They block
    the very requests you're looking for.
    like, 3. Open DevTools (F12) before you load the page. In the Network tab,
    tick "Preserve log" and "Disable cache".
  3. Load the site and don't touch the banner.
  4. Filter for the usual suspects: google-analytics, googletagmanager,
    doubleclick, facebook, clarity.ms, hotjar, tiktok,
    tbh, linkedin, fonts.googleapis. In Chrome, the "3rd-party requests"
    filter helps you spot the ones you didn't expect.
  5. Check Application → Cookies and Local Storage. _ga, _gcl_au,
    _fbp, _hj* before any click is a red flag.
  6. 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 tbh, 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.
    honestly, - Plugins and apps that inject their own tracking, especially on
    WordPress and Shopify.
    in my experience, - 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:

Js
import { chromium } from "playwright";

const TRACKERS = /google-analytics|googletagmanager|doubleclick|facebook|clarity\.ms|hotjar|tiktok|linkedin|fonts\.googleapis/;

const thirdParty = (reqs) =>
.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 = [];

const before = thirdParty(seen);

// Common wording; extend for your banner and language.
like, const reject = page.getByRole("button", { name: /reject|decline|deny|only necessary|ablehnen/i }).first();
in my experience, 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);

in my experience, 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 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:

honestly, - The regex is a starting point, not a tracker database. Print the full `before` list 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, like, 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 tbh, report is free and needs no sign-up, if you want to compare it with what your own script finds:

The study with method and limits is here:

like, if your banner breaks the script in an interesting way, tell me in the comments. Those are the cases I learn the most from.

Anyway, that's my take on it! What do you guys think?

Comments (0)

No comments yet. Be the first to join the dialogue!