List site sessions
const url = 'https://digize.com/api/v1/analytics/sessions?days=30&outcome=lead&channel=direct&visit=new';const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”How many days back from now to read: 90 at most.
How many days back from now to read: 90 at most.
One site’s sessions, by its Worker id; every site’s when left out.
One site’s sessions, by its Worker id; every site’s when left out.
A UTM source or referring host, such as google.com.
A UTM source or referring host, such as google.com.
Mobile, desktop or tablet.
Mobile, desktop or tablet.
Two capital letters, such as US.
Two capital letters, such as US.
The path the session started on, such as /pricing.
The path the session started on, such as /pricing.
A visitor’s first session, or a later one.
A visitor’s first session, or a later one.
True for sessions with JavaScript errors or error pages, false for none.
True for sessions with JavaScript errors or error pages, false for none.
True for sessions that look like a bot’s (bot or likely_bot), false for the rest.
True for sessions that look like a bot’s (bot or likely_bot), false for the rest.
The nextCursor of the page before. Leave it out for the first page.
The nextCursor of the page before. Leave it out for the first page.
Rows on the page: 50 unless it says, 100 at most.
Rows on the page: 50 unless it says, 100 at most.
Responses
Section titled “Responses”Done
object
object
The persistent visitor id; null when the browser kept none.
Which of the visitor’s sessions this is, from 1; 0 when unknown.
Page views.
The UTM source, or the referring host when there’s none; empty for direct.
What the session led to, as the server recorded it.
object
Added up, in minor units of currency; refunds positive.
JavaScript errors.
Pages answered 404 or 5xx.
The furthest scroll mark reached, in percent.
The slowest Largest Contentful Paint, where the browser reports it.
Whether a replay was recorded.
Pass it as cursor for the next page; null on the last.
object
Sessions with a lead, a booking or a purchase.
Page views per session.
Engaged time per session.
Sessions with rage or dead clicks.
Every site with matching sessions, whichever is picked.
object
Example
{ "rows": [ { "outcomes": [ { "name": "lead" } ], "bot": "bot" } ]}What was sent isn’t valid (invalid).
object
object
object
Example
{ "error": { "code": "invalid" }}No key, or one that’s unknown, off or expired.
object
object
object
Example
{ "error": { "code": "invalid" }}The key doesn’t have the permission this needs.
object
object
object
Example
{ "error": { "code": "invalid" }}Nothing has that id (not_found).
object
object
object
Example
{ "error": { "code": "invalid" }}Over the rate limit; see retry-after.
object
object
object
Example
{ "error": { "code": "invalid" }}