Privacy & compliance

ClickStream is built for operators who want to own their visitor data without inheriting a vendor's consent-posture problems. The SDK ships strict-by-default: no identity resolution, no behavioral trackers, no fingerprinting, no replay — until the visitor's consent state says otherwise.

Consent model

Every event the SDK emits is gated by a consent state stored in the _cs_consent first-party cookie + local-storage slot. The consent state is a tri-state per category:

CategoryDefaultWhat it gates
analyticsgranted or banner_default depending on your site's compliance presetpageview, click, scroll, session tracking
identitydenied until explicit grantConsent('identity')HEM / phone / customer-id / social-id capture + transmission
marketingdenied until explicit grantConsent('marketing')click-id attribution (gclid, fbclid, etc.), UTM capture, replay, behavioral trackers

Revoking consent clears every identity slot from storage + cookies, pauses the affected trackers, and emits a _consent_transition event so the server can scrub downstream state.

Compliance presets

Set the preset at install time via data-compliance or the compliance config option:

<script
  src="https://t.example.com/sdk.js"
  data-key="cs_live_..."
  data-compliance="gdpr_strict"
  async
></script>
new IdentityTracker({ apiKey, endpoint, compliance: 'gdpr_strict' });
PresetConsent modeBanner on loadScrub levelIdentity / fingerprint defaultRetention
standardopt_outNostandardallowed when visitor identifiesindefinite (per plan)
gdpr_strictopt_inYesaggressivedenied until marketing consent13 months
ccpaopt_outNo (link in footer sufficient)standardallowed; honors DNT + GPC12 months
hipaaopt_inYesaggressive + field encryptiondeniedcontract-specific
cpraopt_outNoaggressivehonors GPC auto-opt-out12 months

The preset sets server-side defaults via ClientConfig.complianceProfile, which the collector uses to reject any event that carries fields the preset would have stripped — defense-in-depth against an old SDK bundle being cached on a visitor's device.

Banner + CMP detection

When showBannerOnLoad: true, the SDK renders the built-in banner on first visit with Accept-All / Reject-All / Customize controls. You can style it to match your site via consentBannerConfig or bring your own banner entirely:

import { hasConsent, grantConsent, revokeConsent } from '@clickstream/sdk';

hasConsent('analytics');        // boolean
grantConsent(['analytics', 'identity']);
revokeConsent('marketing');

The SDK also auto-detects existing CMPs (OneTrust, Cookiebot, Didomi, TrustArc, Osano, Sourcepoint) via their IAB TCF v2 API and mirrors the consent decision. You don't have to double-banner your visitors.

What's scrubbed at which level

standard scrub

aggressive scrub

All standard rules plus:

Raw PII — encrypted at rest, reveal-gated

When a site enables raw-value capture (email pre-encrypt on the server, form fills, IP addresses), values are AES-256-GCM encrypted with a unique key per site before they hit D1. Raw plaintext is never persisted anywhere.

Reveal requires all of:

  1. Dashboard operator with decrypt:read permission.
  2. Password re-authentication within the last 5 minutes (/decrypt re-auth gate).
  3. A recorded audit row (audit_log) that captures operator id + IP + target visitor + timestamp + reason text.
  4. Rate-limit allowance (10 reveals per operator per 5 minutes).

The audit log is append-only, retained 7 years, and surfaced to site admins on the Security → Reveal Audit tab. No one at ClickStream can reveal raw values on your behalf; the keys live under per-site HSM-backed KMS in your Cloudflare account.

Visitor rights — DSAR / export / deletion

Every dashboard site admin can:

Use tracker.revokeIdentity() + the dashboard delete action for a full visitor scrub.

Server-side compliance enforcement

The SDK already strips fields based on the compliance profile before transmission, but the collector strips them again as defense-in-depth. A cached old SDK bundle on a visitor's device can't smuggle fields past the collector — the server's ClientConfig.complianceProfile rules run on every event regardless of SDK version.

Regional considerations

Data residency

DPA + sub-processor list

A Data Processing Agreement is available on request for Builder+ tiers; Scale+ customers get a DPA appended to the MSA on provisioning. Current sub-processors:

The sub-processor list is published at einstein.clickstream.com/legal/sub-processors — we update it 30 days before adding any new sub-processor.

See also