> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Introduction

## Article: Introduction

## Article Link: https://dev.wix.com/docs/api-reference/business-management/ai-site-chat/statistics-v2/introduction.md

## Article Content:

# About the Wix Assistant Statistics API

The Wix Assistant Statistics API provides read-only access to aggregated analytics data for AI Site-Chat interactions on a site. Use this API to monitor chat performance, track visitor engagement, and analyze how AI Site-Chat contributes to product discovery and support outcomes.

With this API, you can:

+ Retrieve daily KPI data for the last 30 days.
+ Access period KPI data comparing the last 30 days with the previous 30 days.
+ Request only the KPI fields your app needs.
+ Monitor metrics such as conversations, visitors, product exposures, orders, replied conversations, and response times.
+ Build custom analytics dashboards for AI Site-Chat performance monitoring.

## Before you begin

It's important to note the following points before starting to code:

+ The API is read-only and provides no ability to modify or delete statistics data.
+ Statistics are scoped to the authenticated site. You don't specify a site ID in the request.
+ Daily KPI data is returned for up to 30 days.
+ Period KPI data is returned for predefined comparison periods.
+ When you don't pass `dailyFields` or `byPeriodFields`, the response includes the default KPI field sets.
+ Deprecated typed fields may be present for backward compatibility. Use `dailyKpis` and `periodKpis` for new integrations.

## Use cases

The following use cases are supported:

+ [Monitor AI Site-Chat performance metrics](#monitor-ai-site-chat-performance-metrics)
+ [Build analytics dashboards for chat engagement](#build-analytics-dashboards-for-chat-engagement)
+ [Compare current and historical chat performance](#compare-current-and-historical-chat-performance)

## KPI fields

Default daily KPI fields include:

+ `kpi_date`
+ `mode`
+ `conversations_count`
+ `visitors_distinct_count`
+ `exposed_items_count`
+ `total_orders_count`
+ `replied_conversations_count`
+ `response_time_seconds_p50`
+ `first_response_time_seconds_p50`

Default period KPI fields include:

+ `period`
+ `mode`
+ `conversations_count`
+ `visitors_distinct_count`
+ `exposed_items_count`
+ `total_orders_count`
+ `replied_conversations_count`
+ `response_time_seconds_p50`
+ `first_response_time_seconds_p50`

## Terminology

+ **Daily KPI**: Key performance indicators aggregated by day for the authenticated site.
+ **Period KPI**: Aggregated statistics for predefined comparison periods.
+ **Conversations**: Individual chat sessions between visitors and the AI assistant.
+ **Visitors**: Unique site visitors who engaged with the AI Site-Chat feature.
+ **Exposed items**: Product items that were shown or recommended to visitors during chat interactions.
+ **Orders**: Orders associated with AI Site-Chat activity.
+ **Replied conversations**: Conversations that received a response.
+ **Response time**: Median response-time KPI values, returned in seconds. Common fields include `response_time_seconds_p50` and `first_response_time_seconds_p50`.
+ **last_30_days**: Rolling 30-day period from the current date.
+ **previous_30_days**: The 30-day period immediately before the last 30 days, used for comparison.

