Skip to main content
Custom Events

Learn how Custom Events work in LiveSession and discover step-by-step methods for their implementation to track specific user interactions.

Patryk avatar
Written by Patryk
Updated over 2 months ago

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.

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:

You can pass up to 50 properties with every event to better understand your visitors’ behavior. Here’s an example of a code snippet (Read more about Refine Events):

__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.

Why Use Event Properties?

Event properties are powerful for performing aggregations in Metrics, allowing you to calculate:

  • Sum
    Example: Total revenue from subscriptions.

  • Average
    Example: Average price of subscribed plans.

  • Minimum and Maximum
    Example: The lowest or highest subscription price over time.

For instance, when tracking a "User Subscribed" event, you can add a property for the subscription price. Using these properties in Metrics enables you to analyze the overall performance of your subscriptions and gain deeper insights into user behavior.

Custom events and their properties will also be available on the session player’s timeline on the right side of the screen:

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

Did this answer your question?