Consent, Do Not Track and Global Privacy Control

Run the tracker only after consent, and how it reacts to Do Not Track and Global Privacy Control signals.

Updated

The tracker respects browser privacy signals out of the box, and it can wait for your cookie banner before it reads or writes anything.

Global Privacy Control#

When a browser sends Global Privacy Control, the tracker does not track that visitor at all. This cannot be turned off.

Do Not Track#

Do Not Track is respected by default: visitors who send it are not tracked. If you decide to measure them anyway, add data-respect-dnt="false" to the snippet.

If you need consent before analytics cookies, add data-consent-required="true" to the snippet:

<script async src="https://platform.getboostra.com/t.js?v=..." data-website-id="..." data-consent-required="true"></script>

Keep the rest of your snippet as it is and only add the attribute. In consent mode nothing is read from or written to the browser, and no events are sent, until consent is given. Automatic user recognition stays off too.

Call this from your cookie banner when the visitor accepts analytics:

window.boostra?.("consent", true);

It also accepts { analytics: true } or { granted: true }. Tracking starts right away, without a page reload. If your banner sets a global flag instead, the tracker also reads window.boostraConsent === true.

Any other value withdraws consent:

window.boostra?.("consent", false);

Withdrawing consent stops tracking and deletes the visitor, session and first-touch cookies and storage, so the visitor starts fresh if they agree again later.

What this means for your numbers#

Visitors who decline, or who send these signals, are not counted. Your visitor totals will be lower than the real traffic, and the gap depends on your audience and your banner. Revenue from Stripe or Shopify still arrives, but payments from untracked visitors stay unattributed (how revenue is matched).

Whether you need consent mode depends on where your visitors are and on your own legal advice. The cookies involved are listed in Cookies and browser storage.

Related articles