Sessions
Operations around Sessions and Session data.
Endpoints
Filters#
All Endpoints marked with filters can now be filtered with the parameters below.
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | (optional) Name of URL. |
referrer | string | (optional) Name of referrer. |
title | string | (optional) Name of page title. |
query | string | (optional) Name of query parameter. |
browser | string | (optional) Name of browser. |
os | string | (optional) Name of operating system. |
device | string | (optional) Name of device (ex. Mobile). |
country | string | (optional) Name of country. |
region | string | (optional) Name of region/state/province. |
city | string | (optional) Name of city. |
hostname | string | (optional) Name of hostname. |
language | string | (optional) Visitor browser language (ex. en-US). |
tag | string | (optional) Name of tag. |
event | string | (optional) Name of event. |
distinctId | string | (optional) Name of distinct ID. |
utmSource | string | (optional) UTM source. |
utmMedium | string | (optional) UTM medium. |
utmCampaign | string | (optional) UTM campaign name. |
utmContent | string | (optional) UTM content. |
utmTerm | string | (optional) UTM term. |
segment | uuid | (optional) UUID of segment. |
cohort | uuid | (optional) UUID of cohort. |
GET /api/websites/:websiteId/sessions#
Gets website session details within a given time range.
Parameters
| Parameter | Type | Description |
|---|---|---|
startAt | number | Timestamp (in ms) of starting date. |
endAt | number | Timestamp (in ms) of end date. |
search | string | (optional) Search text. |
page | number | (optional, default 1) Determines page. |
pageSize | number | (optional, default 20) Determines how many results to return. |
filters | - | Can accept filter parameters. |
Sample response
GET /api/websites/:websiteId/sessions/stats#
Gets summarized website session statistics.
Parameters
| Parameter | Type | Description |
|---|---|---|
startAt | number | Timestamp (in ms) of starting date. |
endAt | number | Timestamp (in ms) of end date. |
filters | - | Can accept filter parameters. |
Sample response
pageviews: Page hitsvisitors: Number of unique visitorsvisits: Number of unique visitscountries: Number of unique countriesevents: Number of events
GET /api/websites/:websiteId/sessions/weekly#
Get collected count of sessions by hour of weekday.
Parameters
| Parameter | Type | Description |
|---|---|---|
startAt | number | Timestamp (in ms) of start date. |
endAt | number | Timestamp (in ms) of end date. |
timezone | string | Timezone (ex. America/Los_Angeles). |
filters | - | Can accept filter parameters. |
Sample response
GET /api/websites/:websiteId/sessions/:sessionId#
Gets session details for an individual session
Sample response
GET /api/websites/:websiteId/sessions/:sessionId/activity#
Gets session activity for an individual session
Parameters
| Parameter | Type | Description |
|---|---|---|
startAt | number | Timestamp (in ms) of starting date. |
endAt | number | Timestamp (in ms) of end date. |
Sample response
GET /api/websites/:websiteId/sessions/:sessionId/properties#
Gets session properties for an individual session
Sample response
GET /api/websites/:websiteId/session-data/properties#
Gets session data counts by property name
Parameters
| Parameter | Type | Description |
|---|---|---|
startAt | number | Timestamp (in ms) of starting date. |
endAt | number | Timestamp (in ms) of end date. |
propertyName | string | (optional) Filter results to a specific property name. |
filters | - | Can accept filter parameters. |
Sample response
GET /api/websites/:websiteId/session-data/values#
Gets session data counts for a given property
Parameters
| Parameter | Type | Description |
|---|---|---|
startAt | number | Timestamp (in ms) of starting date. |
endAt | number | Timestamp (in ms) of end date. |
propertyName | string | Property name. |
dataType | number | (optional) Filter by data type (1=string, 2=number, 3=date, 4=boolean). |
filters | - | Can accept filter parameters. |
Sample response
GET /api/websites/:websiteId/session-data-pivot#
Gets session data in a pivoted format, with each row representing a session and its properties as parallel arrays.
Parameters
| Parameter | Type | Description |
|---|---|---|
startAt | number | Timestamp (in ms) of starting date. |
endAt | number | Timestamp (in ms) of end date. |
propertyName | string | Session property name to pivot on. |
page | number | (optional, default 1) Determines page. |
pageSize | number | (optional, default 20) Determines how many results to return. |
filters | - | Can accept filter parameters. |
Sample response
GET /api/websites/:websiteId/session-data/stats#
Gets aggregated activity statistics for sessions grouped by a given property value.
Parameters
| Parameter | Type | Description |
|---|---|---|
startAt | number | Timestamp (in ms) of starting date. |
endAt | number | Timestamp (in ms) of end date. |
propertyName | string | Property name to group by. |
filters | - | Can accept filter parameters. |
Sample response
Results are ordered by activity descending. Maximum 100 rows returned.