Developer quickstart
Learn how to get started with LiveSession.
LiveSession is a powerful tool that helps you understand how users interact with your product. This guide will help you get started with LiveSession and start capturing user interactions and analyzing them.
Overview
LiveSession collects data about user interactions, such as clicks, scrolls or touches in different platforms like web or mobile. Each platform can be accessed in different environment like specific web framework or via servier using a raw protocol like http. That's why we provide a variety of ways to integrate LiveSession into your product.
Install code snippet
This is the simplest way to get LiveSession up and running on browser environment. It only takes a few minutes.
First, install LiveSession browser SDK via package manager:
1 npm install @livesession/browser
After, copy the snippet below and replace YOUR_TRACK_ID
with your project's values.
1 import ls from "@livesession/browser";2 3 // init a script, trackID is required4 ls.init("<YOUR_TRACK_ID>", options, sdkOptions);
Or, if you want to use window API
then add snippet within the <head>
tags at the base of your product - ideally just before the closing </head>
tag.
This ensures LiveSession loads on any page users visit.
Full pre-filled snippet is available in your website settings.
Identify users
To identify users, you can set a user data. This is useful for tracking users across multiple devices and sessions. Learn more about identify API here.
1 import ls from "@livesession/browser";2 3 ls.identify({name: "John Doe", email: "john.doe@example.com"})
User params
You can also set user properties to track additional information about your users.
1 import ls from "@livesession/browser";2 3 ls.setCustomParams({plan_str: "premium", team_str: "marketing"})
Learn more about user params API here.
Send events
Most of events are autocaptured by LiveSession, but you can also send custom events.
1 import ls from "@livesession/browser";2 3 ls.track("User Subscribed", {plan_str: "premium"})
More details about events API can be found here.
Choose a web framework
LiveSession provides SDKs for popular frameworks and languages to make it easier to integrate into your product like React, Vue or Angular. More information about how to install and use the web frameworks can be found here.