About the Analytics Sessions API

The Analytics Sessions API enables select beta users to access session IDs collected from Wix sites.

Beta Feature:

This functionality is currently available to select beta users only.

A session refers to a visitor's interaction with a site, beginning when they arrive and concluding after 30 minutes of inactivity. During each session, a visitor can take multiple actions and navigate through multiple pages. Each session is uniquely identified by a browser session ID.

Wix offers Wix users an entry point to access selected analytics apps that record and track visitor sessions. When a Wix user accesses the entry point, Wix passes all relevant filters appended to the iframe URL, and your app can use the filter data to request a list of relevant visitor sessions from Wix. With this API, your app can extend Wix analytics data to help site owners identify pain points and find areas for improvement.

Use cases

Before you begin

  • This functionality is currently available to select beta users only. If you are interested in providing such an app, reach out to Wix Support.
  • Some calls in this API are asynchronous and return a job ID.
  • All sessions are identified by their browser session IDs.
  • An iframe dashboard page extension is required.

Terminology

  • Session: A visit of a visitor to a site. Within each session, a visitor can take multiple actions and view multiple pages.
  • Browser session ID: An ID stored in the visitor's browser to identify the session.
Did this help?

Sample flows

This article shares some possible use cases your app could support, as well as an example flow that could support each use case. You're certainly not limited to these use cases, but they can be a helpful jumping off point as you plan your app's implementation.

Beta Feature:

This functionality is currently available to select beta users only.

Record a visitor session and notify Wix that a recording has been made

When your app recognizes that a visitor session has begun, your app should:

  1. Collect the browser session ID.
  2. Record the visitor's session on the site, and map it to the browser session ID.
  3. Notify Wix that a recording has been made by calling the Mark Session as Recorded endpoint and passing the browser session ID.

Display session recordings to users based on Wix's filter data

When a site user (admin or contributor) accesses the dedicated entry point for your app:

  1. Wix calls your extension's iframe URL with filter data as query parameters.
  2. Collect the filter data from the query parameters.
  3. Call List Sessions Async with the filters from step 2.
  4. Collect the job ID and call Get List Sessions Job Result.
  5. If the job is complete, collect the returned session IDs.
  6. Display the browser sessions with the IDs returned in step 5.
Did this help?

Session Object


Properties
idstringformat GUID

Session ID.

Did this help?

POST

List Sessions Async


Start an async job to retrieve a list of session IDs, given the specified filters. The following filters must be passed:

  • Time period, either predefined or custom.
  • Session filter, either navigation flow (page interactions), conversion funnel steps, or device type.
Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Session Recording Analytics - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/analytics/v1/sessions/list/async

Body Params
timezonestringmaxLength 100

User's timezone. Defaults to timezone as set in the Site Properties API.


ONE OF:

customTimePeriodCustomTimePeriod

Custom time period with start & end dates.


predefinedTimePeriodstring

Predefined time period.


ONE OF:

navigationFlowNavigationFlow

Navigation flow details.


conversionFunnelConversionFunnel

Conversion funnel details. The steps in the journey the visitor has taken on the site.


deviceTypeDeviceType

Device type.

Response Object
jobIdstringformat GUID

List sessions job ID. Pass this ID to Get List Sessions Job Result to retrieve job details and metadata.

List Sessions Async
Request
cURL
curl -X POST \ 'https://www.wixapis.com/analytics/v1/sessions/list/async' \ -H 'Content-type: application/json' \ -H 'Authorization: <AUTH>' \ -d '{ "deviceType": { "type": "MOBILE" }, "predefinedTimePeriod": "LAST_30_DAYS" }'
Response
JSON
{ "jobId": "a391a44f-b037-4344-b555-6f5be67c4123" }
Did this help?

GET

Get List Sessions Job Result


Retrieves the job status and a list of session IDs, if ready.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Session Recording Analytics - all permissions
Learn more about app permissions.
Endpoint
GET
https://www.wixapis.com/analytics/v1/sessions/list/result

Query Params
jobIdstringRequired

List sessions job ID.


limitintegerRequired

Number of items to load.


offsetintegerRequired

Number of items to skip in the current sort order.

Response Object
resultResult

List sessions job result data.

Request
cURL
curl -X GET \ 'https://www.wixapis.com/analytics/v1/sessions/list/result?jobId=a391a44f-b037-4344-b555-6f5be67c4123&limit=5&offset=0' \ -H 'Content-type: application/json' \ -H 'Authorization: <AUTH>'
Response
JSON
{ "result": { "jobStatus": "IN_PROGRESS", "total": 0, "sessionIds": [] } }
Did this help?

POST

Mark Session As Recorded


Marks a browser session as recorded.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Session Recording Analytics - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/analytics/v1/sessions/session-recorded

Body Params
sessionIdstringRequiredminLength 1maxLength 100

Browser session ID.

Response Object
Returns an empty object.
Mark Session as Recorded
Request
cURL
curl -X POST \ 'https://www.wixapis.com/analytics/v1/sessions/session-recorded' \ -H 'Content-type: application/json' \ -H 'Authorization: <AUTH>' \ -d '{ "sessionId": "7f08f28b-f4ca-47be-879e-c871966ee0c0" }'
Response
JSON
{}
Did this help?

POST

Mark Recordings As Deleted


Marks browser session recordings as deleted.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Session Recording Analytics - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/analytics/v1/sessions/recordings-deleted

Body Params
sessionIdsArray <string>RequiredminItems 1maxItems 100minLength 1maxLength 100

Browser session IDs.

Response Object
Returns an empty object.
Mark Session Recordings as Deleted
Request
cURL
curl -X POST \ 'https://www.wixapis.com/analytics/v1/sessions/recordings-deleted' \ -H 'Content-type: application/json' \ -H 'Authorization: <AUTH>' \ -d '{ "sessionIds": ["7f08f28b-f4ca-47be-879e-c871966ee0c0", "29c8ae61-88b3-4589-b14a-9faaaa7fb8be"] }'
Response
JSON
{}
Did this help?