Metrics

Analyze key metrics to gain insights into user behavior and performance.

Metrics in LiveSession allow you to compute and analyze various metrics over time. Use this feature to:

  1. Track key performance indicators (KPIs) and metrics.

  2. Identify metrics and patterns in user behavior.

  3. Gain actionable insights to improve your product.

Overview

Metrics enable you to compute metrics based on user activity and other data points in your application. These metrics help you understand user behavior and performance over time.

With the LiveSession API, you can programmatically define, query, and analyze metrics to gain insights into metrics.

Compute

Use the following API request to compute a metric:

Compute a metric
1
curl https://api.livesession.io/v1/compute/metric \\
2
-X POST \\
3
-H "Content-Type: application/json" \\
4
-H "Authorization: Bearer $LIVESESSION_PAT" \\
5
-d '{
6
"website_id": "YOUR_WEBSITE_ID",
7
"compute": {
8
"date_range": {
9
"from": "2024-01-01",
10
"to": "2024-12-31"
11
},
12
"filters": {
13
"must": [
14
{
15
"name": "event.custom_name",
16
"data": {
17
"string": {
18
"operator": "eq",
19
"values": [
20
"Signup Form: filled"
21
]
22
}
23
}
24
}
25
]
26
},
27
"type": "sessions",
28
"histogram": {
29
"aggs_func": "sum",
30
"interval": "week"
31
}
32
}
33
}'

This request computes the number of sessions where the Signup Form: filled event occurred. The result is aggregated by week in histogram format.

About more compute options read API reference.

 

Next steps

APIs and references

Explore the API reference and documentation for more details.

Funnels