cd /news/ai-agents/your-cookie-banner-says-reject-does-… · home › topics › ai-agents › article
[ARTICLE · art-175196] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=· neutral

Your cookie banner says Reject. Does your code listen?

A developer at privacy compliance tool Kiescy built an MCP server that loads a live site in a real browser as a first-time visitor, records what fires before any consent choice, clicks Reject, and records what still loads, then hands those findings to an AI coding assistant for fixes with human approval on every change. The post cites a 2025 PETS study finding roughly half of websites set a third-party tracking cookie before consent, and a $1.55M Healthline settlement partly over a banner that did not stop tracking cookies. It also outlines three remediation patterns: inert type="text/plain" scripts, moving iframe src into data attributes, and wrapping SDK init calls behind a consent gate.

recommendation

Have your coding agent audit the live rendered site in a real browser, not just the repo, and require human approval on each consent-gating change it proposes.

more in playbook: Designing agent systems
by read4 min views3 publishedNov 24, 2026

Most cookie banners look fine. You click Reject, the banner goes away, and everyone moves on. But the banner is only half the job. The other half is your code: every analytics tag, pixel and embed has to wait for that choice. Often it doesn't.

This isn't rare. A 2025 study found that about half of websites send a tracking cookie to a third party before the visitor has consented (PETS 2025). In 2025 Healthline agreed to a $1.55M settlement, partly because its banner didn't actually turn off tracking cookies (CMSWire).

This post covers how to check your own site in five minutes, the three patterns that fix most leaks, and how I now get an AI coding assistant to do the fix over MCP, with me approving every change.

collect, gtag, fbevents, pixel, clarity, hotjar, tiktok. Anything that shows up here loaded _ga, _gid, _fbp or _clck showing up after Reject means something isn't waiting. If step 4 or 5 shows requests, your banner is decoration. The good news: the fix is usually small.

Almost always it's one of these:

<head>.<script src="https://www.googletagmanager.com/gtag/js?id=G-XXXX"> the moment it parses it. Your banner hasn't even loaded yet.posthog.init() or analytics.load() in _app.tsx / main.ts runs on page load, whatever the visitor chose. These are the patterns most consent tools support in some form. The attribute names below are Kiescy's, but the idea is the same everywhere.

1. Scripts: make them inert until consent. A script with type="text/plain" is never run by the browser. The consent tool switches it on when the visitor allows that category.

<!-- before -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXX"></script>

<!-- after: tag the  AND its inline config -->
<script type="text/plain" data-pira-category="analytics" async
        src="https://www.googletagmanager.com/gtag/js?id=G-XXXX"></script>
<script type="text/plain" data-pira-category="analytics">
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date()); gtag('config', 'G-XXXX');
</script>

In React or Next.js, check the rendered HTML: some components drop or rewrite the type attribute.

2. Iframes and pixels: move src out of the way. The browser can't contact a server it doesn't have an address for.

<iframe data-pira-category="social"
        data-pira-src="https://www.youtube.com/embed/VIDEO_ID"></iframe>

3. SDKs started in code: wrap the init.

window.pira.when("analytics", () => {
  posthog.init("KEY", { api_host: "https://eu.posthog.com" });
});

// If this can run before the consent script has loaded, queue it:
(window.piraQueue = window.piraQueue || []).push((pira) => {
  pira.when("advertising", startAds);
});

And if a visitor withdraws consent later, a script that already ran can't be unloaded. Call the SDK's opt-out (posthog.opt_out_capturing()) or reload the page.

None of this is hard. It's just tedious: you have to find every tag across layouts, components and third-party snippets, and know which category each tracker belongs to. That's a good job for an AI coding assistant, if it knows what's actually wrong on the live site. Guessing from the code alone misses tags that come from a CMS, a tag manager or a plugin.

This is why I built an MCP server for Kiescy, the privacy compliance tool I work on. (Disclosure: I'm the founder.) Kiescy visits your live site in a real browser as a first-time visitor, records what loads before any choice, clicks Reject, and records what still loads. The MCP server hands those findings to your assistant:

Tool What the assistant gets
list_issues /get_issue What loaded, on which page, which category it belongs to, and the suggested fix
get_fix_prompt Step-by-step instructions for your codebase, including the tagging rules above
get_consent_api How new code should wait for consent, so the next tag you add doesn't leak
run_check /get_check Re-checks the live site after you deploy, and closes the issues that are gone

It also checks accessibility (WCAG A/AA with axe-core) and security headers, and the same tools cover those.

Connecting it in Claude Code is one line (Cursor and VS Code configs are in the repo):

claude mcp add --transport http kiescy https://mcp.kiescy.com/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"

Then I just say: "Fix the Kiescy issues on this site."

The part I cared most about is that the assistant doesn't get to just start editing. The server tells it to search the code, show a plan (files and changes) and wait for an explicit OK. The key only covers one website, and through MCP the assistant can't change the banner, account settings or consent records. After I deploy, it calls run_check, and the issue only closes if the live site no longer shows it.

There's a second server, https://mcp.kiescy.com/mcp/documents, for legal pages. It asks about your business a few questions at a time, drafts or imports your privacy policy, terms and cookie policy, and only publishes after a one-time confirmation in the chat. It never guesses things like where your customers are or what you collect.

I'd love feedback from anyone building MCP servers or dealing with consent on client sites. What would you want an assistant to be allowed to do here, and what should always need a human?

Kiescy's checks help you comply. They aren't legal advice.

── more in #ai-agents 4 stories · sorted by recency
── more on @kiescy 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/your-cookie-banner-s…] indexed:0 read:4min 2026-11-24 · —