Browse documentation

Consent and privacy

Control when collection begins, respect visitor choices, and keep sensitive information out of analytics events.

Require consent

Tracwell respects Do Not Track by default. Start with required consent when your consent flow must run before collection.

TypeScript
const analytics = createTracwell({
  collectionMode: "product",
  consent: "required",
  projectKey: "tw_live_...",
});

analytics.setConsent("granted");

Call setConsent("denied") when consent is withdrawn. Tracwell stops listeners, removes queued events, and resets identity.

Collect only what you need

Your privacy notice should describe the collection mode, identity behavior, and custom events you configure. Do not put sensitive data or secrets in event properties.