Skip to content
The Anatomy of Tag Leakage: How Pixels, Session Replays, and Trackers Bypass Standard Banners

The Anatomy of Tag Leakage: How Pixels, Session Replays, and Trackers Bypass Standard Banners

Gbhackers •Kavichselvan • November 26, 2026

A consent banner is a preference requirement. It writes a cookie or localStorage key recording the visitor’s choice for any code that decides to read it.

Nothing in the banner stops a script tag from executing or a request from leaving the browser. Tag leakage is the gap between those two things: the banner says “rejected” while the DOM keeps sending data to third parties.

For security teams this is a familiar problem: an authorization check enforced by convention, not by the runtime. Below: how trackers get around banners, how to test for it, and why litigators and regulators care.

Since 2025, regulators in California and France have issued fines for exactly this gap, and California’s browser opt-out law takes effect in January 2027.

Legal content in this article is informational only and is not legal advice.

Why a consent banner is not a security control

Most consent management platforms (CMPs) publish a consent state that tags are expected to check before firing. Every tag that does not check, or checks too late, is outside the control.

A rule that depends on every caller voluntarily asking permission is a request, not a control.

The OWASP Top 10 Client-Side Security Risks project lists this exact problem as “Sensitive Data Leakage”: the inability to detect or prevent digital trackers and pixels across a web property so that privacy laws are followed ( OWASP, Top 10 Client-Side Security Risks ).

The same list includes “Lack of Third-party Origin Control” and “JavaScript Drift.”

The supply-chain side is well documented on this site. Magecart groups have hidden payment skimmers inside tag manager containers ( Magecart Hackers Exploit Google Tag Manager to Inject Credit Card Skimmers ), and the polyfill.io takeover showed how one third-party script reference can change behavior across many sites ( Over 380,000+ Hosts Embedding Polyfill JS script Linking to Malicious Domain ).

Privacy leakage uses the same plumbing, except the code is usually legitimate and working as designed.

Seven ways tag leakage happens around the banner

Leaks usually come from ordinary engineering decisions. Nobody connected them to the consent layer.

A marketer pastes a pixel into the theme header, or a plugin injects its own script. The CMP does not know these exist, so it cannot hold them back, and they fire on first paint.

2. Tag manager misconfiguration

A tag set to fire on “All Pages” with no consent condition runs before the visitor sees the banner. Custom HTML tags are a common weak point because they can load further scripts the container never lists.

Attackers abuse the same capability ( Attackers Abuse Google Tag Manager to Skim Payment Cards ).

3. Race conditions before consent loads

If the CMP loads asynchronously and a tag runs before the default “denied” state is written, the tag sees no signal, and many tags treat that as permission.

Google Consent Mode v2 exists partly for this reason: it expects a default consent state to be set before any Google tag runs, and the CMP must load early enough to set it.

A few hundred milliseconds is enough for a page-view hit carrying the URL, referrer and a device identifier.

4. Beacons that outlive the page

Trackers send data with navigator.sendBeacon(), fetch() with keepalive, or a 1×1 image carrying the payload in its query string.

Beacons are built to complete as the page unloads, so a “reject” click that reloads the page can still be followed by a flush of queued events.

5. PII in URLs and query strings

terms, email addresses and sometimes health conditions end up in URLs through GET forms and reset links. Any pixel reporting document.location or the referrer ships that string to its vendor.

6. Server-side tagging and CNAME cloaking

Some deployments route tracking through a first-party subdomain, such as metrics.example.com, that is a DNS CNAME to a vendor. Browsers and many scanners treat it as first-party, so it bypasses blocklists.

Server-side tag managers go further, forwarding events to vendors from the site’s own servers, out of sight of client-side tools.

7. Fourth-party chains

A vendor’s script often loads other vendors, such as identity partners or ad exchanges. One approved tag can mean five origins receiving data.

The Meta and Yandex localhost research reported here showed how far a tag’s behavior can reach beyond what the site owner expects ( Meta Bypassed Privacy Protections to Track Android Users ).

Session replay and form-field capture

Session replay scripts collect content, not just events. They serialize the DOM, record mouse movement and capture input as it is typed, before the user presses submit.

In a 2017 Princeton CITP study, researchers found replay scripts on 482 of the Alexa top 50,000 sites and showed that scripts collected text typed into forms before submission ( Englehardt, Acar and Narayanan, Princeton CITP, 2017 ).

On a pharmacy site, prescription names and health conditions were captured, and no provider automatically redacted displayed page content.

Redaction is configuration, and configuration drifts. A new checkout field or a login with a plain-text “show password” input becomes recorded content unless someone updates the masking rules.

Extensions show the same client-side pattern, as in the harvesting of browsing histories from millions of users ( Chrome and Firefox Browser Extensions Steals Browsing Web Histories From Over 4M Users ).

The legal exposure: wiretap claims, health data and regulators

The legal questions map to technical facts: what was sent, to whom, when, and whether valid consent existed at that moment. Timing is often decisive.

CIPA Section 631 and the timing of consent

The California Invasion of Privacy Act prohibits reading the contents of a communication in transit without consent. In Javier v. Assurance IQ (May 31, 2022), the Ninth Circuit held that Section 631(a) requires the prior consent of all parties.

For engineers, a tag that fires before consent is recorded is the fact pattern. While there have been some bad actors in the space where Vivek Shah has filed and sent out thousands of CIPA violation requests.

Luckily the team at Captain Compliance broke the story this bad actor and saved businesses millions of dollars from having to be paid out for non-compliance.

OneTrust, CookieYes, and Cookiebot were the top targeted consent banners in Vivek’s crusade of bar privacy lawsuit demand letters.

Penal Code 637.2 allows the greater of $5,000 per violation or treble actual damages, and actual damages need not be shown ( Cal. Penal Code 637.2 ). Per-visitor counting drives settlement pressure.

Standing is the main brake on these suits. In Popa v. Microsoft (August 26, 2025), the Ninth Circuit affirmed dismissal of a session replay case because recording routine browsing on a retail site was not a concrete injury ( Ninth Circuit, 2025 ), and at least one California district court has since relied on it to deny class certification in a CIPA case ( Mayer Brown, 2026 ).

The practical takeaway: replay or pixels that capture health, financial or account data carry far more risk than a recording of clicks on a product page.

Section 638.51 and SB 690

From 2023, plaintiffs filed suits arguing that pixels and beacons are “pen registers” under Section 638.51, following a federal ruling in Greenley v. Kochava that read the definition broadly enough to cover software ( K&L Gates, 2024 ).

Governor Newsom signed SB 690 on September 30, 2026, which, starting January 1, 2027, removes the private right of action for Section 638.51 claims over website and app conduct, leaving them to the Attorney General, while Sections 631 and 632 stay intact ( Morgan Lewis, 2026 ).

Exposure remains. Commentators expect plaintiffs to move to Section 631 and to claims that cookie banners or settings tools fail to honor rejections, or that cookies drop before promised consent ( ZwillGen, 2026 ).

Those claims turn on whether observed traffic matches the banner’s promise.

Health data: pixels, OCR and the FTC

In September 2023, Judge William Orrick (N.D. Cal.) let federal and state wiretap claims proceed in the consolidated Meta Pixel healthcare class action ( GovInfoSecurity, 2023 ).

HHS OCR’s tracking technology bulletin, issued in December 2022 and updated in March 2024, was partly vacated in June 2024 by a Texas federal court, which struck the portion on IP addresses combined with visits to unauthenticated public pages ( Hall Render, 2024 ).

In February 2023, GoodRx agreed to a $1.5 million civil penalty in the first enforcement action under the Health Breach Notification Rule, over sharing medication and health condition data with , Google, Criteo and others ( FTC, 2023 ).

In March 2023, BetterHelp agreed to $7.8 million in consumer refunds over sharing email addresses, IP addresses and health questionnaire information with , Snapchat, Criteo and ( FTC, 2023 ).

Global Privacy Control

GPC is a browser signal, sent as the Sec-GPC: 1 header and exposed as navigator.globalPrivacyControl. It is easy to include in tests.

In its 2022 Sephora settlement of $1.2 million, the California Attorney General said businesses must treat GPC as a valid opt-out of sale under the CCPA ( California AG, 2022 ).

Regulators are testing banners, not reading them

Enforcement has shifted from policy text to observed behavior. In May 2025, the California Privacy Protection Agency fined clothing retailer Todd Snyder $345,178, alleging that its privacy portal was misconfigured so opt-out requests went unprocessed for 40 days, and the agency stated that using a consent management platform does not excuse a business from compliance ( CPPA, 2025 ).

In September 2025, the agency announced a $1.35 million penalty against Tractor Supply, its largest to date, which included failing to honor opt-out preference signals such as GPC ( CPPA, 2025 ).

European regulators apply the same test. In September 2025, France’s CNIL fined SHEIN 150 million euros after finding that advertising cookies were placed as soon as visitors arrived, before any interaction with the banner, and that new cookies were still set and existing ones still read after users clicked Refuse all ( CNIL, 2025 ).

That is tag leakage, described in a regulator’s own findings.

Expect far more visitors to send GPC soon. California’s Opt Me Out Act (AB 566), signed in October 2025, requires browsers to offer a built-in opt-out preference signal when it takes effect in January 2027 ( CPPA, 2025 ). A site that ignores GPC today will be ignoring a default browser setting tomorrow.

Testing for tag leakage: a practitioner workflow

The goal is to observe traffic in each consent state. The techniques below are free and can run in CI. Domains and selectors are illustrative.

Playwright: load with no consent and log third-party requests

This script opens a fresh context, never touches the banner, and records every request. Run it plain and with –gpc to compare. It also types a canary into an email field without submitting, to reveal form-field capture.

// leak-probe.js usage: node leak-probe.js [–gpc] const { chromium } = require(‘playwright’); const target = process.argv[2]; const gpc = process.argv.includes(‘–gpc’); const site = new URL(target).hostname.split(‘.’).slice(-2).join(‘.’); const CANARY = ‘ [email protected] ’; const piiHint = /(%40|@)[a-z0-9.-]+\.[a-z]{2,}|email=|phone=|canary-7f3a9/i; (async () => { const browser = await chromium.launch(); const context = await browser.newContext({ extraHTTPHeaders: gpc ? { ‘Sec-GPC’: ‘1’ } : {} }); if (gpc) { await context.addInitScript(() => { Object.defineProperty(Navigator.prototype, ‘globalPrivacyControl’, { get: () => true }); }); } const page = await context.newPage(); const hits = []; page.on(‘request’, (req) => { const host = new URL(req.url()).hostname; const firstParty = host === site || host.endsWith(‘.’ + site); const body = req.postData() || ”; hits.push({ t: Date.now(), host: host, firstParty: firstParty, type: req.resourceType(), method: req.method(), pii: piiHint.test(decodeURIComponent(req.url()) + body) }); }); await page.goto(target, { waitUntil: ‘networkidle’ }); const email = page.locator(‘input[type=”email”]’).first(); if (await email.count()) { await email.type(CANARY, { delay: 60 }); // typed, never submitted } await page.waitForTimeout(8000); // banner left untouched const cookies = (await context.cookies()).map((c) => c.name + ‘ @ ‘ + c.domain); const thirdParty = hits.filter((h) => !h.firstParty); console.log(JSON.stringify({ gpc: gpc, thirdPartyHosts: Array.from(new Set(thirdParty.map((h) => h.host))), piiFlagged: hits.filter((h) => h.pii), cookies: cookies }, null, 2)); await browser.close(); })();

Two caveats apply. The script trusts the domain boundary, so a CNAME-cloaked tracker is labelled first-party; resolve unusual subdomains with dig CNAME metrics.example.com. And replay vendors often compress payloads, so a missing canary match does not prove the field was not captured.

DevTools steps for a manual pass

Open an incognito window so no earlier consent cookie exists.

Open DevTools, select the Network tab, tick “Preserve log” and “Disable cache”.

Type -domain:*.example.com in the filter box to hide first-party requests.

Load the page without touching the banner. Every remaining row fired without consent.

Add the “Initiator” column to trace each request, including fourth-party chains, back to the tag that caused it.

In the Application tab, review Cookies and Local Storage before and after clicking “Reject”.

Type a canary into a form, then press Ctrl+Shift+F (Cmd+Option+F on macOS) to requests for it.

CSP in report-only mode as an inventory tool

A report-only Content Security Policy blocks nothing, but it reports every script, connection, image and frame from an unlisted origin. Deployed for a week with a tight policy, it inventories every origin your pages , including ones loaded by other vendors.

Reporting-Endpoints: csp-inventory=” Content-Security-Policy-Report-Only: default-src ‘self’; script-src ‘self’; connect-src ‘self’; img-src ‘self’ data:; frame-src ‘self’; report-to csp-inventory; report-uri

Group the reports by effectiveDirective and blocked URL. A connect-src violation to an ad domain is a beacon or fetch; an img-src violation with a long query string is a pixel. Sample or rate-limit the collector on busy pages.

Pen-test checklist mapped to OWASP

The mappings below use the OWASP Top 10 Client-Side Security Risks and the OWASP Top 10 Privacy Risks v2.0 ( OWASP, 2021 ). “CSR” marks the client-side list.

How Companies Like OneTrust & Captain Compliance approach deep scanning

Scripted tests work for one site and one release but are hard to sustain across many domains, jurisdictions and weekly marketing changes. Captain Compliance’s Cookie Scanner is one option built around the consent-state approach described above.

According to a recent news segment featuring Captain Compliance, its “Radar” engine crawls a URL in six phases, each in a fresh browser: pre-consent, accept, reject, GPC signal, settings panel and IAB TCF v2.

The company says it checks whether trackers stop after reject, whether GPC is honored and whether toggles work, and flags manipulative design such as a missing reject option.

Trackers are classified as Strictly necessary, Analytics, Targeting, Personalization or Unclassified, with vendor, purpose, retention and risk, and results are scored per jurisdiction (EU, UK, US-CA, US-CO, BR) as a letter grade and a 0-100 score.

It also describes an API, a live-scan product called “Patrol” that flags drift from an approved state, and weekly classification updates.

It’s also important to find platforms like Ketch and Captain Compliance that can block non-essential scripts at the DOM level before transmission rather than only logging consent, deploys as a single lightweight tag, and produces timestamped technical records intended for responding to demand letters and regulators.

It also describes a unified platform covering scanning, consent, vendor data mapping and consumer rights requests. These are vendor claims to test like any other.

“Compliance and privacy is not an administrative checkbox or an aesthetic banner, it is a technical control.

If your systems cannot prove when, where, and how user data was isolated or fulfilled at the exact millisecond of interaction, you are operating with an open legal flank.

Thankfully, Captain Compliance has become the company to protect businesses globally from privacy violations and litigation threats,” said a Maria Sanzio, an integrations and data privacy expert.

To evaluate any scanner, run a proof of concept on a staging site. Plant a hardcoded pixel, a tag manager tag with no consent condition, a CNAME-cloaked endpoint and a replay script with an unmasked field, then check which ones the tool reports in the pre-consent and reject phases.

Compare results with your Playwright output and ask how evidence is exported and timestamped.

For a quick baseline before building your own harness, run a free privacy audit of your cookies, tags and pixels, then compare its pre-consent and reject results with what your DevTools pass shows. Treat it as one data point.

Artificial Intelligence

Cyber security Course

Cyber Security Resources

Cybersecurity

Information Gathering

Information Security Risks

Hackers Infect 5,600 Devices With Stealthy Malware That Hides Remote-Control Commands in Normal Traffic

Windows NTLM Security Update Causes Authentication Failures in Third-Party Apps and Devices

Hackers Actively Exploit Critical Drupal Vulnerability to Take Over Websites

Critical GeoServer Vulnerability Chain Lets Hackers Execute Remote Commands Without Authentication

Hackers Poison GitHub Pull Requests With Malware That Can Steal Developer Passwords

CISA Warns of 10 Actively Exploited Vulnerabilities in Juniper, Mitel, Danfoss, and Vates Products

The full story

This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.