Data and security

Consent

Keep Parlox off until your consent tool says yes, and stop it when consent is withdrawn.

The browser part sets no cookies and reads no field values. Whether your site must still hold it until a visitor consents depends on where your customers are and on your own legal advice. Parlox supports both: it can run from the first page, or wait.

With the npm package:

TypeScript
import { init } from "@parlox/browser";

init({ publicKey: "pk_…", consent: "required" });

With the tag, add data-consent="required" (or consent=required in its URL):

HTML
<script async src="https://gateway.parlox.io/sdk/1.0.3/parlox.js" integrity="sha384-naJsIFbLpeBsYg6qCN51Tt54BEFhO4MDhTMmrGP4Ja/nXjrfUziCot/3mHbhqCb+" crossorigin="anonymous" data-key="pk_…" data-consent="required"></script>

Until consent is given, nothing is stored and nothing is sent: nothing is written to sessionStorage, no device signals are read, no beacon is sent and the recorder never loads. When it starts, the browser part only reads its own _plx entry from the tab's sessionStorage (a visit id an earlier page of the tab may have left), and it holds your track() calls and your data layer's messages in memory, to send them if consent comes.

Give and withdraw it

Call these from your consent tool's callbacks:

TypeScript
import { consent } from "@parlox/browser"; // with the tag: window.parlox.consent(...)

consent(true);  // start: the visit is counted from this moment
consent(false); // stop
  • consent(true) starts Parlox on the current page. track() calls made while it waited (at most 100) are sent then, in order.
  • consent(false) stops everything at once, a running recording included. It forgets the tab's visit id and its outbox, and nothing buffered is sent. A later consent(true) starts a new visit, and nothing from the refused period is ever sent.
  • A refusal before Parlox ever started is a decision, not a withdrawal: calls keep waiting for a later grant.

With the tag, a decision made through the pre-load stub before the tag loads counts the same way.

With a tag manager

Two ways work:

  • Fire the Parlox tag only after consent, through your tag manager's consent trigger. Nothing else is needed.
  • Or fire it on every page with consent required (in the Google Tag Manager template, tick Wait for consent), and have your consent tool call parlox.consent(true).

A visit that begins before consent is counted from the grant, so its first page view is late by that much. If the visitor has already left their landing page by then, its campaign tag and referrer are not seen, so an AI referral can be missed.

This is the shape of GA4's basic consent mode, in which nothing fires until consent. Parlox has no cookieless pings before consent: nothing is sent at all.