Identify users within your application

Identifying your users helps you find you find their sessions in the LogRocket dashboard.

Call LogRocket.identify() on page loads to associate your own application-specific user ID with the active user. These user identifiers will be referred to as "UIDs".

LogRocket.identify(uid);

You can use any string that uniquely identifies the user of your application, such as a database ID, an email, or a username.

If you do not provide a UID, the user will be assigned a random one and shown as "Anonymous" in the UI.

LogRocket.identify('123456') // an immutable ID from your database (preferred)
LogRocket.identify('[email protected]') // the user's email

It's recommended to use an immutable database ID if available. Names and email addresses can be added as user traits as they could change.

LogRocket.identify() can be called up to 10 times per session