Get a site session
const url = 'https://digize.com/api/v1/analytics/sessions/example?days=30';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/example?days=30' \ --header 'x-api-key: <x-api-key>'One session in full: every page view, click, scroll, form field, error and Web Vitals reading in order, the outcomes it led to, and the visitor’s other sessions. Pass at, when the session started, to read only the days around it.
Needs the analytics:read permission.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The session id, from a list of sessions.
Query Parameters
Section titled “Query Parameters”When the session started, from a list of sessions.
When the session started, from a list of sessions.
How many days back to look for the session and the visitor’s other sessions: 90 at most.
How many days back to look for the session and the visitor’s other sessions: 90 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.
Everything in order.
object
Pageview, click, scroll, form_abandon, web_vitals, an outcome, or a site’s own event.
Milliseconds, a percentage, a count or an amount in minor units, by name.
object
The session had more events than are read; the last are left out.
object
The order, checkout, appointment or contact it made.
The visitor’s other sessions, the newest first.
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.
Example
{ "session": { "outcomes": [ { "name": "lead" } ], "bot": "bot" }, "events": [ { "source": "browser" } ], "outcomes": [ { "name": "lead" } ], "others": [ { "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" }}