About the Analytics Data API

The Analytics Data API enables you to access a site's analytics data. Data is collected on a daily basis, and organized according to specific categories, called measurement types.

Data measurement types include:

  • Total sessions: Total amount of site visits. A session ends after 30 minutes of inactivity.
  • Total sales: Total amount of money expected from all product and service sales, before deducting refunds, shipping, and fees, including both online and manual payments.
  • Total orders: Total amount of income from sales after deducting refunds.
  • Clicks to contact: Total amount of site sessions where a visitor clicked to contact you via WhatsApp, phone or email.

Use cases

Before you begin

  • Note that Wix stores analytics data for 62 days. 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.
  • Actions that are counted in the "clicks to contact" measurement type do not include form submissions.

Terminology

  • Session: A visit of a visitor to a site. Within each session, a visitor can take multiple actions and view multiple pages.
Did this help?

Sample Flows

This article shares some possible use cases your implementation 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 implementation.

Display an analytics widget with data about a Wix site

You can display analytics data that Wix has collected about a site in a Wix site page or dashboard page, or in an external platform.

  1. Map your widget data to the relevant measurement types.
  2. When a Wix user opens your widget, call Get Analytics Data and include any relevant date range, time zone and measurement types.
  3. Display the returned values.
Did this help?

Data Object


Site analytics data

Properties
idstringformat GUID

Data ID.

Did this help?

GET

Get Analytics Data


Retrieves analytics data, given the specified filtering.

Authentication

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

Permissions
Site Analytics - read permissions
Learn more about app permissions.
Endpoint
GET
https://www.wixapis.com/analytics/v2/site-analytics/data

Query Params
dateRange.startDatestringformat LOCAL_DATE

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.


dateRange.endDatestringformat LOCAL_DATE

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'.


timeZonestring

Time zone.


measurementTypesArray <string>Required

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.
Response Object
dataArray <MeasureItem>

Analytics data per type.

Get site analytics data.
Request
cURL
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>'
Response
JSON
{ "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 } ] }
Did this help?