Skip to content

Consent and privacy

Where you need a visitor’s consent before storing data on their device or tracking them, such as in the EU and UK, turn on consent mode.

cosembra.init('pk_live_REPLACE_ME', {
endpoint: 'https://events.cosembra.com/v1/batch',
requireConsent: true,
})

With requireConsent: true:

  • Nothing is written to the device. The anonymous id, session and queued events are kept in memory only.
  • Nothing is sent. Events you track are queued in memory and wait.

When your consent banner gets an answer, tell the SDK:

// The visitor accepted
cosembra.consent(true)
// The visitor declined
cosembra.consent(false)
Call Effect
consent(true) Saves to the device from now on, and sends the events queued so far.
consent(false) Clears the queue and everything Cosembra stored on the device, and stops tracking. Later track() calls are ignored.

If the visitor accepted on an earlier visit, call consent(true) straight after init() on every page load. Cosembra doesn’t remember the answer for you: your consent tool is the source of truth.

The consent state (granted, denied or unknown) is recorded with every event.

  • IP addresses are never stored. The IP is used to look up the country, if enabled, and then discarded.
  • Personal data is scrubbed. Emails, card numbers and US social security numbers are redacted from all text, values under keys such as password, token and email are removed, and sensitive URL parameters are redacted.
  • Email-shaped user ids are hashed before they’re stored.

This scrubbing is pattern-based. It catches common mistakes, but it can’t recognize every kind of personal data. Avoid sending personal data in the first place: see Don’t send personal data.