Retrieves analytics data, given the specified filtering.
You can only call this method when authenticated as a Wix app or Wix user identity.
Custom start date in ISO 8601 format.
If the period from startDate
to the current date is longer than 62 days, a "Do not have data for this start date" error will be returned.
Custom end date in ISO 8601 format. Returned data will include all dates until the requested end date. For example, { start: '2024-01-01', end: '2024-01-03' } will return data for '2024-01-01' and '2024-01-02'.
Time zone.
Measurement types. Supported values:
TOTAL_SESSIONS
: All site visitor sessions.TOTAL_SALES
: All sales.TOTAL_ORDERS
: All orders.CLICKS_TO_CONTACT
: All clicks of the "contact us" button.Analytics data per type.
curl -X GET \
'https://www.wixapis.com/analytics/v2/site-analytics/data?date_range.start_date=2024-01-01&date_range.end_date=2024-01-05&measurement_types[]=TOTAL_SESSIONS&measurement_types[]=TOTAL_ORDERS' \
-H 'Content-type: application/json' \
-H 'Authorization: <AUTH>'
{
"data": [
{
"type": "TOTAL_SESSIONS",
"values": [
{ "date": "2024-01-01", "value": 10 },
{ "date": "2024-01-02", "value": 7 },
{ "date": "2024-01-03", "value": 3 },
{ "date": "2024-01-04", "value": 0 }
],
"total": 20
},
{
"type": "TOTAL_ORDERS",
"values": [
{ "date": "2024-01-01", "value": 3 },
{ "date": "2024-01-02", "value": 1 },
{ "date": "2024-01-03", "value": 0 },
{ "date": "2024-01-04", "value": 0 }
],
"total": 4
}
]
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.