Passer au contenu de la documentation

Runtime security and data flows

Every request the CookieBeam banner script makes from a visitor's browser, what each one carries, how IP addresses are handled, and how the banner sits in your page.

Dernière mise à jour:

This page lists what the CookieBeam script does in a visitor's browser: the files it loads, the requests it sends, and what each request carries. Use it for a security review or a data-flow record.

It describes a banner published with the current CookieBeam version. A banner that hasn't been published for a long time may send fewer of these requests until you publish again.

Hosts

HostUsed for
cdn.cookiebeam.comFiles the browser downloads: scripts, the stylesheet, translations, the known list, and the location lookup
cookiebeam.comRequests that send data: consent records, impressions, drift and load-order reports. On IAB TCF banners, also the vendor-list fallback and the Google provider list
app-worker.visitor-analytics.io, privacy-analytics-proxy.visitor-analytics.ioOnly with the visitor-analytics integration turned on. See Third-party script the runtime adds

On IAB TCF banners, the vendor list can come from one more CookieBeam-hosted address. See The IAB vendor list.

Your site's own cookies are never attached to these requests. These hosts are on a different domain from your site.

Files the script downloads

These are plain downloads. They send no request body.

FileWhen
loader.jsEvery page view. This is the tag you install
latest.jsEvery page view. The loader adds it
The banner runtime (cookiebeam-core.umd.min.js) and its stylesheet (cookiebeam-core.css)After the page's HTML has been parsed. Can be skipped in a region where you've hidden the banner
The framework bundle (cookiebeam-core-framework.umd.min.js)Only on banners with IAB TCF or GPP turned on
A translation file (translations/platform/LANGUAGE.json)Only when the visitor's language isn't included in latest.js. See Languages
known.jsonOnly when a drift or load-order report has something to send. Once per page
geoOnly when regional settings are on for the banner and the visitor's location didn't arrive with latest.js
The IAB vendor list and its translationsOnly where IAB TCF applies to the visitor
Google's Additional Consent provider list (/api/tcf/google-atp)Only on IAB TCF banners that use Google Additional Consent providers
The banner logo imageOnly if you uploaded one

Visitor location

CookieBeam's CDN adds the visitor's country and region to latest.js as it serves the file. The banner uses them to pick a regional rule. The script doesn't ask the browser for a location and never uses the browser's geolocation API.

If the country is missing and regional settings are on for the banner, the script requests geo from the CDN once, without credentials, and waits at most 800 milliseconds. If no answer arrives, the banner uses its fallback rule.

The IAB vendor list

The IAB Global Vendor List is loaded from CookieBeam's own copies: a CookieBeam-hosted file store first, then cookiebeam.com/api/tcf/gvl. The script never loads it from the IAB's own host. If you run a content security policy, roll it out in report-only mode to see the file store's address, as the content security policy guide describes.

The Google provider list request carries the provider IDs configured for the banner in its URL. It's the same URL for every visitor.

Third-party script the runtime adds

With the visitor-analytics integration turned on for the banner, and only on the hostnames configured for it, the runtime adds that vendor's main.js to the page once a consent record exists. It loads from privacy-analytics-proxy.visitor-analytics.io when the visitor hasn't accepted the integration's category, and from app-worker.visitor-analytics.io when they have. This is the one third-party script the CookieBeam runtime adds by itself. What that script sends is up to the vendor.

Requests that send data

Every request below goes to cookiebeam.com and carries the banner's public ID. Most also carry a per-banner token that is built into the script. The token is the same for every visitor.

POST /api/consent/log

Sent when a visitor makes or changes a choice. It's also sent for a visitor who gets a default without choosing, where that default grants something: an opt-out or notice region, or a region where the banner is hidden. While an A/B test runs, a default that grants nothing yet is sent too, so the test can be measured.

It carries:

  • the time of the choice
  • the accepted categories, and purpose choices on banners that use them
  • which button was used, and whether the choice came from the banner, the preferences window or the API
  • the page's hostname
  • the referring page's origin and path, when the browser exposes a referrer. The query string and fragment are removed in the browser
  • the country and region the CDN supplied, the consent model applied, and the regional rule that matched
  • the banner language, the published version and the environment
  • the A/B test variant, if a test is running
  • whether the browser sent Global Privacy Control or Do Not Track
  • the Google Consent Mode signals that were sent for this choice, when available
  • consentId, the consent identifier the banner created for this choice, when the consent ID setting is on and the choice receives one. Omitted otherwise
  • endsConsentId, the identifier from a previous choice that this decision replaces. Present when the visitor had a cb1_… identifier and then made a different choice or the setting was turned off
  • an automation score for the visit, when available
  • technical fields: the consent revision, where the location came from, and whether an A/B test changed the consent model
  • the TC string, the Google Additional Consent string and the vendor-list version, on IAB TCF banners
  • the GPP string, on GPP banners

The stored record keeps the page's hostname, not the page URL. The stored referrer is cut down to your banner's telemetry grouping level. At the default level that's the origin only.

POST /api/consent/impression

Sent at most once per page view, when the consent banner is shown. It carries the A/B test variant, the country and region, and whether the visit looked automated. It carries no consent ID, no URL and no referrer, and the script reads no cookies to build it.

Drift reports

POST /api/scan/drift, /api/scan/script-drift and /api/scan/connection-drift

Sent only when your plan includes Tracker Tripwire. See Drift monitoring.

The drift reporter reads document.cookie to get the names of the cookies your page can see. It skips CookieBeam's own cb_cookie and cb_geo_lang_cache. It reports names that aren't on the banner's known list, plus a small sample of names that are. It never sends a cookie's value.

Each report carries:

  • the page's hostname
  • pageUrl, a redacted form of the page address (see below)
  • a random batch ID, the script version and a timestamp

On top of that:

ReportEach item carries
CookiesThe cookie name, how often it was seen, and what triggered the check
ScriptsThe element type (script, iframe or tracking-pixel image), its host, its redacted URL, and counts
ConnectionsThe destination host, its redacted URL, a path pattern, the request type and method, whether it's third-party, and counts of allowed and blocked requests

The redacted page URL

pageUrl is never the full address. What it holds depends on the banner's telemetry grouping:

  • Origin (the default): the origin only, such as https://www.example.com. Connection reports send / as the path pattern.
  • Origin and path, or full URL: the origin and the path. Path segments that look like an email address, a UUID, a number, or a long token are replaced with :email, :uuid, :id and :token.

The query string and the fragment are never sent at any level. Script and connection URLs go through the same redaction.

Load-order report

POST /api/scan/load-order

Checked once per page view, after the page has finished loading. Sent only when the check finds something to report. See Load order.

It carries:

  • the page path, without the query string
  • the origin and path of scripts placed before the CookieBeam tag, and of requests that started before it
  • for inline scripts, only the name of a known tag pattern that matched. The script's text is matched in the browser and isn't sent
  • whether the CookieBeam tag is async, defer or injected, and whether a Consent Mode default was set first
  • the platform it detected: Google Tag Manager, Shopify, WordPress or manual

The script reads no cookies to build it, and it carries no consent ID.

Enforcement summary

POST /api/telemetry/enforcement-summary

This is a private preview. It's off unless CookieBeam has turned it on for your team, and then it runs on a sample of page views.

It carries counts only: how many scripts and connections were allowed or blocked per category, and how many cookies were seen or cleaned up. It also carries the page's origin, the current and default consent state, the regional framework, and whether the browser sent Global Privacy Control or Do Not Track. Each report has a random page-view ID that exists only in memory for that page. It isn't written to a cookie or to browser storage.

POST /api/cdn/consent-handoff

Sent only on banners with cross-domain consent turned on. When a visitor follows a link to another of your configured domains, the script sends the visitor's current choice and the link's address, and gets a short token back. The destination page sends that token and the referring hostname to fetch the choice. Both requests are sent without credentials.

What isn't sent

  • Values of your site's cookies. Drift reports carry cookie names only. CookieBeam does send values from its own consent record: the choices and their timestamps in the consent record request, and the choices, timestamps and language in the cross-domain handoff. When consent ID is on and the choice receives one, the consent record request also carries the consent ID that the banner created for that decision. When a later decision replaces a previous cb1_… identifier, the request carries that previous identifier too.
  • Query strings and fragments of your pages, with one exception. The cross-domain handoff sends the full address of the link the visitor follows, including its query string. CookieBeam's server keeps only the hostname. Links that have a fragment aren't handed off.
  • Page content, form fields or the text of inline scripts.
  • The user agent as a field. No request body includes it. The browser still sends its usual User-Agent header.

IP addresses

Each request reaches CookieBeam with the visitor's IP address, as any web request does. An edge network sits in front of both hosts. It supplies the address and the visitor's country to CookieBeam. The sub-processors page names it.

The application uses the full address in these places:

  • Rate limiting, on the endpoints above. The cross-domain handoff keys its limit on the visitor's network (an IPv4 /24 or an IPv6 /64), not the full address.
  • Security log entries. For consent records and drift reports, when a request comes from a domain that isn't authorized for the banner. For drift reports, also when a source goes over the per-banner rate limit.
  • A log entry for every accepted drift report, on all three drift endpoints. It records the address so a wrong inventory entry can be traced back to its source.

These are application logs. The address isn't written to the consent record or to the drift rows in your inventory.

A consent record doesn't store the IP address. It stores a keyed hash of the visitor's network instead: the first three parts of an IPv4 address (a /24), or the /48 of an IPv6 address. CookieBeam uses it to cap how many records one network can add to your quota in a day. It also uses it to check that an alert about unknown visitor locations comes from several networks and not from one sender. The record also stores the country the CDN saw for the request. Drift reports use the same hash to count how many different networks reported an item before it's added to your inventory.

A second keyed hash, of the exact IPv4 address or the IPv6 /64, backs a daily storage limit per source. It's a counter and isn't stored on the consent record.

The cross-domain handoff stores a keyed hash of the visitor's network (an IPv4 /24 or an IPv6 /64, finer than the /48 used for consent records) with each handoff token. When the destination page fetches a choice that grants consent, CookieBeam checks that the request comes from the network the token was issued to. The token record is short-lived, and it's deleted when the token is used.

The hash is a pseudonym, not anonymous data. It uses a secret key held on CookieBeam's servers. Someone with that key could test addresses against it.

How the banner sits in your page

The banner renders in the normal page DOM, as a div with the ID cb-main. It doesn't use a Shadow DOM. Two things follow:

  • Your site's CSS can reach the banner. Scope any override to #cb-main.
  • Your content security policy applies to the banner's styles.

Browser functions the loader replaces

To block scripts and requests, the loader changes objects your own code also uses:

  • With blocking on, it wraps the DOM methods that insert content, such as appendChild, insertBefore, append, insertAdjacentHTML, innerHTML and Range.insertNode/surroundContents, and it overrides document.createElement. With script blocking on, it also hooks setAttribute and the src and srcset setters of script, iframe, image and embed elements.
  • With connection blocking on, or on banners with consent purposes turned on, it wraps fetch, XMLHttpRequest, navigator.sendBeacon, WebSocket and EventSource.
  • On banners with consent purposes turned on, it redefines document.cookie, wraps Storage.prototype.setItem, and where the browser supports it replaces window.localStorage and window.sessionStorage with a proxy. A write that belongs to a purpose the visitor hasn't allowed is dropped.

The placeholder shown over a blocked embed is different. It does render inside a shadow root. See Blocking.

What blocked requests get back

When connection blocking stops a request, the script answers it itself. Nothing is held back and replayed later.

APIWhat the calling code sees
fetch()An empty response with status 204 and the header X-CookieBeam-Blocked: 1
XMLHttpRequestAn error event, then loadend
navigator.sendBeacon()true, as if the beacon was queued
WebSocketA closed socket that fires error, then close with code 1006
EventSourceA closed source that fires error

If your own code calls a blocked endpoint, check for that header before treating a 204 as success.

Content security policy

If your site sends a content security policy, allow these:

DirectiveSource
script-srchttps://cdn.cookiebeam.com
style-srchttps://cdn.cookiebeam.com and 'unsafe-inline'
connect-srchttps://cdn.cookiebeam.com and https://cookiebeam.com. On IAB TCF banners, also the vendor-list file store
img-srchttps://cdn.cookiebeam.com

With the visitor-analytics integration, also allow https://app-worker.visitor-analytics.io and https://privacy-analytics-proxy.visitor-analytics.io in script-src, plus whatever that vendor's script needs in connect-src. The two hosts aren't enough by themselves under a host-based policy. The runtime adds the vendor's starter code as an inline script, and that inline script then loads main.js. An inline script needs 'unsafe-inline' or a hash in script-src, and the hash depends on your site ID. 'strict-dynamic' doesn't cover inline scripts either.

style-src needs the CDN host because the banner stylesheet loads from there. Leave it out and the banner appears unstyled.

The full guide covers nonces, 'strict-dynamic', why styles need 'unsafe-inline', and a report-only rollout: Content security policy.