Browse documentation

Identity and sessions

Choose how Tracwell recognizes visitors and sessions, then identify signed-in accounts only when the product needs it.

Choose a collection mode

Collection modes
Private mode
The default. No cookies, localStorage, or sessionStorage. Visitor identity is privacy-preserving and scoped to a project and day. Reloading can start a new session.
Product mode
Persists anonymous, session, and optional user identity. Sessions expire after 30 minutes of inactivity and rotate when campaign context changes.

Identify signed-in accounts

In Product mode, identify signed-in accounts with an opaque internal ID. Do not use an email address or other personal data.

TypeScript
analytics.identify("customer_123", { plan: "pro" });

const session = analytics.getSession();
// Pass session.sessionId and session.anonymousId to your server-created
// checkout metadata so its verified revenue event can preserve attribution.

// Start fresh after logout.
analytics.reset();

getSession() is available only while Product-mode collection is allowed. Use its opaque identifiers when a checkout is created in your backend so a later server revenue event can join the same visit without putting a server key in the browser.

Session identifiers are attribution context, not authorization. Set revenue user_id from your authenticated server or verified payment webhook, never from a client-supplied value.