identify() to attach your own user ID and optional traits to the current session, so you can find a specific user’s sessions in the dashboard and connect journeys to real accounts.
Usage
identify() whenever the user becomes known: after login, after signup, or on page load if the user is already authenticated.
Parameters
How traits are handled
- Trait values are converted to strings before sending. Nested objects arrive as their string representation, so prefer flat, scalar values.
- Empty or non-string keys are dropped.
- Traits are capped at 256KB total. If the cap is reached, remaining traits are dropped and a warning is logged.
Behavior notes
identify()must be called afterinit()has resolved; it needs the backend session to exist. Called earlier, it logs a warning and does nothing.- Calling
identify()again updates the identity on the same session, for example when a user switches accounts. - Identity applies to the current session. On later visits, call
identify()again once the user is known.
Traits are visible to your team in the dashboard alongside the session. Do not put secrets or highly sensitive personal data in traits.