Skip to content

Identify users

Call identify() after your product has authenticated a user and you know the stable identifier used by your application.

window.analytics.identify("usr_123", {
plan: "growth",
workspace_id: "ws_456",
});
  • After sign-in, sign-up, or SSO completes.
  • After an account switch if the new identity is known.
  • When an anonymous user becomes a known user, before tracking the next meaningful authenticated action.

Identity is scoped to the browser session. The SDK also maintains an anonymous browser identifier so activity can begin before the user authenticates.

window.analytics.reset();

Call this when a user signs out, before an account switch, or on a shared-device handoff. The runtime clears the current identity and starts a new anonymous/session context.

The optional attributes object adds context to the identify action. Send only current, product-relevant values that your organization is permitted to process.

window.analytics.identify(user.id, {
account_role: user.role,
billing_plan: user.plan,
});

Do not treat identify() as a place to upload a complete customer record. Keep sensitive data out of client-side analytics.