Skip to content

List site sessions

GET
/api/v1/analytics/sessions
curl --request GET \
--url 'https://digize.com/api/v1/analytics/sessions?days=30&outcome=lead&channel=direct&visit=new' \
--header 'x-api-key: <x-api-key>'

Visits to the workspace’s sites, the newest first, each with where it came from, its device, its pages, what went wrong (errors, rage and dead clicks) and what it led to. Narrow by outcome (one by name, any for a lead, booking or purchase, or none for sessions that converted to none of those), channel, source, device, country, landing page, new or returning visitors, problems, and whether it looks like a bot. The first page also counts every match in summary. Pass nextCursor back as cursor for the next page.

Needs the analytics:read permission.

days

How many days back from now to read: 90 at most.

integer
default: 30 >= 1 <= 90

How many days back from now to read: 90 at most.

site

One site’s sessions, by its Worker id; every site’s when left out.

string
/^[A-Za-z0-9_-]{1,64}$/

One site’s sessions, by its Worker id; every site’s when left out.

outcome
string
Allowed values: lead booking checkout_start checkout_abandoned purchase refund any none
channel
string
Allowed values: direct search social ai email paid referral internal
source

A UTM source or referring host, such as google.com.

string
>= 1 characters <= 100 characters /^[A-Za-z0-9 _.,:/@+-]{0,100}$/

A UTM source or referring host, such as google.com.

device

Mobile, desktop or tablet.

string
>= 1 characters <= 100 characters /^[A-Za-z0-9 _.,:/@+-]{0,100}$/

Mobile, desktop or tablet.

country

Two capital letters, such as US.

string
/^[A-Z]{2}$/

Two capital letters, such as US.

landingPage

The path the session started on, such as /pricing.

string
/^\/[A-Za-z0-9\-._~!$&()*+,;=:@%/]{0,255}$/

The path the session started on, such as /pricing.

visit

A visitor’s first session, or a later one.

string
Allowed values: new returning

A visitor’s first session, or a later one.

errors

True for sessions with JavaScript errors or error pages, false for none.

boolean

True for sessions with JavaScript errors or error pages, false for none.

rageClicks
boolean
deadClicks
boolean
bot

True for sessions that look like a bot’s (bot or likely_bot), false for the rest.

boolean

True for sessions that look like a bot’s (bot or likely_bot), false for the rest.

cursor

The nextCursor of the page before. Leave it out for the first page.

string
<= 400 characters

The nextCursor of the page before. Leave it out for the first page.

limit

Rows on the page: 50 unless it says, 100 at most.

integer
>= 1 <= 100

Rows on the page: 50 unless it says, 100 at most.

Done

Media typeapplication/json
object
rows
required
Array<object>
object
session
required
string
siteId
required
string
hostname
required
string
visitor
required

The persistent visitor id; null when the browser kept none.

string | null
visit
required

Which of the visitor’s sessions this is, from 1; 0 when unknown.

number
startedAt
required
string format: date-time
endedAt
required
string format: date-time
durationMs
required
number
events
required
number
pages
required

Page views.

number
landingPage
required
string
exitPage
required
string
channel
required
string
source
required

The UTM source, or the referring host when there’s none; empty for direct.

string
campaign
required
string
referrer
required
string
device
required
string
browser
required
string
os
required
string
country
required
string
city
required
string
outcomes
required

What the session led to, as the server recorded it.

Array<object>
object
name
required
string
Allowed values: lead booking checkout_start checkout_abandoned purchase refund
count
required
number
value
required

Added up, in minor units of currency; refunds positive.

number
currency
required
string
contactId
required
string | null
rageClicks
required
number
deadClicks
required
number
errors
required

JavaScript errors.

number
pageErrors
required

Pages answered 404 or 5xx.

number
formsAbandoned
required
number
maxScroll
required

The furthest scroll mark reached, in percent.

number
engagedMs
required
number
lcpMs
required

The slowest Largest Contentful Paint, where the browser reports it.

number | null
replay
required

Whether a replay was recorded.

boolean
bot
required
Any of:
string
Allowed values: bot likely_bot
nextCursor
required

Pass it as cursor for the next page; null on the last.

string | null
summary
required
Any of:
object
sessions
required
number
converted
required

Sessions with a lead, a booking or a purchase.

number
pages
required

Page views per session.

number
engagedMs
required

Engaged time per session.

number
withErrors
required
number
frustrated
required

Sessions with rage or dead clicks.

number
sites
required

Every site with matching sessions, whichever is picked.

Array<object>
object
id
required
string
hostname
required
string
sessions
required
number

Example

{
"rows": [
{
"outcomes": [
{
"name": "lead"
}
],
"bot": "bot"
}
]
}

What was sent isn’t valid (invalid).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

No key, or one that’s unknown, off or expired.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The key doesn’t have the permission this needs.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Nothing has that id (not_found).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Over the rate limit; see retry-after.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}