How to identify users and add custom properties?

Kamil Drazkiewicz
Kamil Drazkiewicz2 minMay 11, 2022

If you identify users visiting your website in any way, you can pass that data to LiveSession. It will add another dimension to your research and provide you with valuable information about your visitor’s behavior. In LiveSession, you can define up to 50 custom properties for each session.

To pass data to LiveSession, you have to install our tracking code first. You can learn how to do it in this guide.

Users identification

The most common way to identify a user is to use their name or email address. You can use one or both strings, according to your needs:

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

To pass additional parameters, add them as params: {key: value}:

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

Remember to update sample values. You have to trigger the function on every page view as we do not store custom properties’ values in any way.

Custom properties are available from the Starter plan up. If you’d like to add custom properties and you’re on a Micro plan, consider switching plans.

Sessions from identified users will be listed on the sessions list, along with their email addresses. From here, you will also be able to access all of the custom properties you passed to LiveSession:

Adding custom properties and identify users

You can also access custom properties directly from the session player. They are available in the right panel, under the “Properties” tab:

Adding custom properties and identify users

You can also use the user’s name, email address and custom parameters you passed as filters to search sessions matching your criteria:

Adding custom properties and identify users

Set custom properties without identifying users

You can pass custom properties to LiveSession without identifying your users. To do so, use the__ls("setCustomParams", data) function. Here’s an example of the snippet you can use to update sessions’ parameters:

__ls("setCustomParams", {
 params: {
   order_id: "123-abc-def",
   plan: "premium",
 },
});

Remember to update sample values. You have to trigger the function on every page view as we do not store custom properties’ values in any way.

Custom Params Limitations

2022 05 11 12h01 30

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.

Related articles

    Start understanding
    your users today

    Free 14-day trial

    No credit card required

    Easy setup