How to identfiy users and add custom properties

Sometimes you need to identify users on your website. LiveSession provides you with a method, which you can use to give an additional context to session replays.

If you want to identify your user by name or email, please add this JavaScript snippet after LiveSession installation tag:

__ls("identify", { 
        name: "Adam McKenzie", 
        email: "adam@goodstuffinc.com"
});

You need to add values dynamically to these properties. This method should be used every page view (LiveSession tracking code doesn't add a cookie with these values). A recorded session would look like that on the session list in LiveSession:

There's also a way to define custom properties for each session. Please check the code below:

__ls("identify", { 
        name: "Adam McKenzie", 
        email: "adam@goodstuffinc.com",
        params: {
          account_id: "101", 
          plan: "premium" 
        }
});

The result would look like that in session replay player:

You can also filter sessions by custom properties to search specific users:

Custom Params Limitations

Name

Type

Maximum length

Details

Name

String

128

Displays user names in app

Email

String

128

Displays user email

Params

JSON object

50 items

Valid JSON object {param1: value, param2: value, ... }

param.key

string

64

{key:value}

param.value

string

64

{key:value}

Rate limiting

Calls to Record Session API (rs.livesession.io) for __ls("identify") are rate limited per-session to 5 requests per second and 10 request per minute. If these limits are exceeded, custom params won't be set.

Didn’t find an answer?

Try using the search engine or just contact us

hello@livesession.ioChat with us

Related topics

Start Using LiveSession For Free!

Test all LiveSession features for 14 days, no credit card required.

checkmarkFree 14-day trial

checkmarkNo credit card required

checkmarkEasy setup