Privacy signals (GPC and DNT)
How CookieBeam detects and honors Global Privacy Control and Do Not Track browser signals.
Last updated:
Browsers and extensions can broadcast a visitor's privacy choice before any banner interaction. CookieBeam detects two signals and can apply them to the visitor's stored consent state automatically.
What the signals do
When a respected signal is present for a visitor in an opt-out region, CookieBeam removes the signal-covered categories from the pre-activated defaults before writing the visitor's initial record. Concretely:
- The stored record contains only the categories that survive the strip:
readOnly(necessary) categories are never removed, even if misconfigured into the block list. - The record is stamped
gpcRespected: true(when GPC applied), so the audit trail shows the choice came from the signal. - Because the strip happens before any tags fire, the blocked categories never execute for that visitor.
Which categories a signal covers is configurable per rule or globally (categoriesToBlock); with no list configured, a respected signal strips every non-readOnly category.
Global Privacy Control (GPC)
GPC is read from navigator.globalPrivacyControl. Honoring is on when either:
- you enable it (globally via the privacy-signals settings, or via the
gpcconfiguration key; an explicitgpckey wins over the general setting), or - the visitor matches a US opt-out regional rule (the CCPA or US opt-out framework presets, or any rule whose privacy-signal mode is
hard_optout).
The second case is a hard floor: for visitors under US opt-out regimes, GPC honoring cannot be switched off by banner settings. Everywhere else the toggle is advisory and yours to set.
Signal modes
Each regional rule (or the global default) picks how a respected signal presents:
hard_optout: the signal is the visitor's choice. The banner does not auto-show (the visitor has nothing left to opt out of), and an optional toast acknowledges "Your Global Privacy Control preference has been respected." The banner stays reachable through the floating settings button and the JavaScript API. The toast only renders when the governing record is the machine-written, signal-shaped default, never over a visitor's earlier explicit choice.preselect_deny: the banner still auto-shows, with the signal-covered categories pre-set to denied so the visitor can confirm or adjust.
Configuring the categories a signal covers
The configuration names specific category IDs that the signal blocks. Two paths exist:
| Configuration path | What it controls |
|---|---|
privacySignals.categoriesToBlock | Dashboard-configured list of categories the signal affects |
gpc.autoOptOutCategories | Self-hosted API equivalent. When both paths are set, privacySignals.categoriesToBlock takes precedence |
When neither is set, the signal affects every category the visitor can toggle.
To block only marketing: set categoriesToBlock to ["marketing"]. The visitor's analytics and preferences stay granted even with GPC active.
Per-region overrides can narrow or widen this list. A CCPA rule might block ["marketing", "analytics"] while a Colorado rule blocks ["marketing"] only.
The confirmation toast
US state regulations (CCPA regs section 7025(c)(6)) say businesses should confirm that they honored an opt-out preference signal. CookieBeam can show a small toast that disappears on its own after the configured duration.
The toast appears only when:
- A respected signal (GPC or DNT) was detected and honored
- The signal mode is
hard_optout - The signal actually changed the visitor's consent state
- The global
showToastsetting is enabled in privacy signal settings
The toast is a global setting, not per-rule. Every dashboard-created banner defaults to showToast: true. Self-hosted configs that omit the privacySignals object get no toast. Regional rules control the signal mode and categories but do not independently toggle the toast.
Toast configuration:
| Field | Description |
|---|---|
| Duration | How long the toast stays visible before auto-dismissing. Configurable via toastDurationMs |
| Text | The toast message, configurable in the gpcToast section of each language's translation |
The toast is not shown when the signal is present but wasn't honored (for example, if the visitor already opted in and the mode is preselect_deny).
Per-region overrides
Privacy signal behavior can vary by region. A regional rule can override both the mode and the categories:
- A GDPR rule might ignore GPC entirely (no US legal mandate in the EU)
- A CCPA rule might use
hard_optoutformarketingandanalytics - A Colorado rule might use
hard_optoutformarketingonly
The override applies only to visitors matched by that rule. The precedence chain:
- The matched regional rule's
privacySignalsoverride - The fallback's
privacySignalsoverride (when no rule matches) - The global
privacySignalsconfiguration - Built-in defaults (GPC off, DNT off)
Do Not Track (DNT)
DNT is a deprecated signal and is off by default. If you enable it, a DNT visitor gets the same category stripping and the same mode semantics as GPC; but not the same audit stamp. The gpcRespected record marker is GPC-specific: a record shaped only by DNT has no marker on the stored record showing a signal shaped it. If your audit process needs to distinguish signal-shaped records, only GPC provides that today. Most sites should leave DNT off and rely on GPC.
Signal status tracking
The runtime tracks what happened with each signal on every page load:
| Status | Meaning |
|---|---|
none | No signal detected |
honored | Signal detected and applied to every applicable right |
partial | Signal applied to some rights or categories but not all |
notHonored | Signal present but not applied (rule doesn't honor it, or the visitor opted back in) |
The tracked rights are saleSharing (CCPA sale and sharing of personal information) and targetedAdvertising (state-law targeted advertising opt-out). This status drives the confirmation toast and is available through the runtime's diagnostic APIs.
Server-side: Sec-GPC
Browsers that set GPC also send Sec-GPC: 1 with every HTTP request. Your server sees this on the first request, before the banner has loaded.
CookieBeam doesn't read the header on the server side. The banner handles the signal in the browser. But if your server needs to make its own decisions based on the signal (for example, suppressing a personalized response on the very first page load), check the header yourself:
// Express example
const gpcActive = req.headers['sec-gpc'] === '1';
Whether your server must treat the header as a binding opt-out depends on the laws that apply to your business. CookieBeam handles the client-side enforcement; server-side interpretation is yours.
The consent record
When GPC shapes a visitor's consent, the consent record carries gpcRespected: true. This tells you (and your server, if it reads the consent cookie) that the signal was a factor. The categories array reflects the final state after the signal was applied.
If the visitor later changes their choice through the banner (where the mode allows it), gpcRespected is dropped from the new record. The marker lives only on the record that the signal shaped; an explicit choice replaces it with a record that has no signal marker.
US opt-out choices made through the signal are also recorded in the usOptOutChoices field when applicable. See The consent record for the full field reference.
Detection discipline
Signal detection is deliberately strict: if the browser environment can't be read, CookieBeam assumes no signal rather than opting everyone out. The signal only shapes the machine-written default record; a visitor's later explicit choice in the banner or preferences panel replaces it.
Where to configure signals
Privacy-signal settings live on the banner's Integrations page. Use the Privacy Signals card and its Enable Privacy Signals integration control.
- Enable the integration.
- Choose which signals to respect: GPC (recommended), DNT (off by default).
- Set the global mode (
hard_optoutorpreselect_deny). - Choose which categories to block. Leave empty to block all non-readOnly categories.
- Per-rule signal behavior (mode and covered categories) is set on each regional rule. See Regional rules.
- Save the settings, then Publish the banner.
GPC vs DNT
GPC and DNT are independent. A browser can send one, both, or neither. CookieBeam checks them separately and applies whichever ones your configuration says to respect.
In practice, most configurations respect GPC and ignore DNT. If you're unsure, turn on GPC and leave DNT off. No current privacy law requires honoring DNT, and some browsers have removed the setting entirely.
For how signals interact with regional rules, see Regional rules.