How do the Custom Events work?

Kamil Drazkiewicz
Kamil Drazkiewicz2 minMay 11, 2022

Custom Events are available via JS API. Learn how to use it.

Custom Event - what is it?

Custom events allow you to capture more data with every interaction your customers make with your website, according to your business needs. You decide how custom events are triggered (i.e., clicking a specific button or performing a set of predefined actions). Use Custom events as filters to search sessions that match your research criteria to make it more accurate.

How to pass Custom Event to LiveSession?

To pass Custom Events to LiveSession, call the __ls(“track”) function:

ls("track", "User Subscribed")

Where can I find Custom Events?

Custom Events are available on our filters list. You can find it under toggled search input.

custom events1

Choose one or more Custom Events you passed to LiveSession and use them as a search term. All of the events you sent will be listed on a filters list. If you don’t see your events, please ensure you sent at least one custom event using our API.

The value of a custom event will be identical to its name:

custom events2

You can pass up to 50 properties with every event to better understand your visitors’ behavior. Here’s an example of a code snippet:

__ls("track", "User Subscribed", {
  plan_str: "premium",
  seats_int: 1,
  total_float: 255.50,
  isPatron_bool: true

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 events and their properties will be available on the session player’s timeline, on the right side of the screen:

custom events4

If you want to send custom events, please refer to our technical documentation.

Related articles

    Start understanding
    your users today

    Free 14-day trial

    No credit card required

    Easy setup