---
title: "Identity and sessions"
description: "Understand Tracwell collection modes, visitor identity, and sessions."
documentation: "https://tracwell.app/docs/identity"
markdown: "https://tracwell.app/docs/identity.md"
---

# Identity and sessions

> Understand Tracwell collection modes, visitor identity, and sessions.

## Collection modes

### Private mode

The default. It uses 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

Use an opaque internal ID in Product mode. Do not use an email address or other personal data.

```ts
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();
```
