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.
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.
When your app recognizes that a visitor session has begun, your app should:
When a site user (admin or contributor) accesses the dedicated entry point for your app:
Session ID.
Start an async job to retrieve a list of session IDs, given the specified filters. The following filters must be passed:
You can only call this method when authenticated as a Wix app or Wix user identity.
User's timezone. Defaults to timezone as set in the Site Properties API.
Custom time period with start & end dates.
Predefined time period.
Navigation flow details.
Conversion funnel details. The steps in the journey the visitor has taken on the site.
Device type.
List sessions job ID. Pass this ID to Get List Sessions Job Result to retrieve job details and metadata.
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"
}'
{
"jobId": "a391a44f-b037-4344-b555-6f5be67c4123"
}
Retrieves the job status and a list of session IDs, if ready.
You can only call this method when authenticated as a Wix app or Wix user identity.
List sessions job ID.
Number of items to load.
Number of items to skip in the current sort order.
List sessions job result data.
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>'
{
"result": {
"jobStatus": "IN_PROGRESS",
"total": 0,
"sessionIds": []
}
}
Marks a browser session as recorded.
You can only call this method when authenticated as a Wix app or Wix user identity.
Browser session ID.
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"
}'
{}
Marks browser session recordings as deleted.
You can only call this method when authenticated as a Wix app or Wix user identity.
Browser session IDs.
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"]
}'
{}