Identify the User on Login
What happens? When a visitor logs in, you replace the SDK’s anonymous session ID with their known user ID (often their email). From that point on, every event they generate is attributed to that ID. When to call it? Right after your login flow succeeds. How to call it:userEmail: a unique string for this user.
Revert to Anonymous on Logout
What happens? When they log out, you discard the user’s ID and switch back to a fresh anonymous identifier, so further events aren’t tied to their account. When to call it? Right after your logout flow completes. How to call it:Send or Update User Profile
What happens? You upload the user’s metadata—name, email, organization, phone, plus any custom fields to the analytics backend so you can segment on those attributes. When to call it?- Immediately after login (to set up the profile).
- Any time the user updates their account info.
Putting It All Together
- Anonymous browsing: SDK uses a generated session/device ID.
-
Login:
- Call
login→ switches to the user’s ID. - Call
updateUserDetails→ uploads their profile attributes.
- Call
-
Logout:
- Call
logout→ switches back to anonymous.
- Call