Skip to content
Docs menu · Identify users

Features

Identify Users in Session Recordings

Attach your own user id or email to AnyReplay sessions with identify(), find a customer's recordings by email, and decide what identity data to send at all.

Sessions are anonymous until you say who the visitor is. Calling identify attaches your user id, an email address, or both to the current session, so a support engineer can search for the customer who wrote in and open their recording.

Calling identify

anyreplay('identify', { userId: 'u_42', email: '[email protected]' });

Call it after sign-in, and on each page load or app launch where the user is already signed in — straight after init is fine. Either field may be left out, but at least one is needed; a call with neither is ignored.

From SDK 0.2.3 an identify made before the session's first recording has reached us is held in memory and sent as soon as it has, once; until then there is no session to attach it to. Calls after that are sent at once. Earlier versions sent it straight away and could lose it.

Rules

FieldAccepted
userIdAny string up to 190 characters — your database id, an account number.
emailA valid email address up to 255 characters.

Identify is sent as its own small request, separately from the recording, and is best-effort: a failure is swallowed rather than surfaced to your page or app. It is subject to the same project key, allowed-domain and rate-limit checks as recording.

Finding sessions

In Sessions, the visitor column shows the email address when one has been attached, the user id when only that was sent, and "Anonymous" otherwise; the search box matches by email or URL. The User ID filter finds a person's sessions by their userId, matched exactly, and the player's Details tab shows both. Put sessionId() (web) or getSessionId() (React Native) into your own logs or support tool as well, and you can go from a ticket to its recording without searching.

What to send

  • An opaque userId is often enough, and it reveals far less to a reviewer than an email address does. Your team can look the person up in your own system.
  • Send email when your reviewers need to find a customer by the address they wrote from.
  • When you wait for consent, an identify call made before the visitor agrees is held in memory and sent once recording starts; nothing is sent if they refuse.
  • Recording and identity follow the organisation's data retention: deleting a session deletes it with its identity. To erase everything about one person on request, see privacy requests.