Retrieves analytics data, given the specified filtering.
You can only call this method when authenticated as a Wix app or Wix user identity.
function getAnalyticsData(
measurementTypes: Array<MeasureNameEnum>,
options: GetAnalyticsDataOptions,
): Promise<GetAnalyticsDataResponse>;
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.Field options.
import { analyticsData } from "@wix/analytics-data";
async function getAnalyticsData(measurementTypes, options) {
const response = await analyticsData.getAnalyticsData(
measurementTypes,
options,
);
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.