> 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: Analyze Site Speed and Core Web Vitals

## Article: Analyze Site Speed and Core Web Vitals

## Article Link: https://dev.wix.com/docs/api-reference/business-management/analytics/skills/analyze-site-speed-and-core-web-vitals.md

## Article Content:

# Analyze Site Speed and Core Web Vitals

Wix measures every page load of a site's real visitors and keeps the results in the site's own analytics, in a semantic model of the **Semantic Model API**. This recipe reads that model to answer *"how fast is my site"*, *"how are my Core Web Vitals on mobile"* and *"which pages are slow"*. It is read-only: it changes nothing on the site.

The same model and the same calls serve sites built in the Wix editors and Wix Headless sites; page paths are the site's own paths in both cases.

This recipe is complete on its own for this model; you don't need to open [Query Site Analytics](https://dev.wix.com/docs/api-reference/business-management/analytics/skills/query-site-analytics.md), the general Semantic Model API recipe. It departs from that recipe in two places, on purpose: it skips Get Semantic Model (step 2) and it reads the `total` row instead of `totalsIncluded`. The model needs this because its fields have no descriptions, its values are objects, and one query returns several kinds of rows.

## Prerequisites

- The **Site Analytics – read** permission scope (`SCOPE.DC-ANALYTICS-AND-REPORTS.READ-SITE-ANALYTICS`).
- A site context: every call below is made against one site.

## Required APIs

- **Semantic Model API**: [REST](https://dev.wix.com/docs/api-reference/business-management/analytics/semantic-models/introduction.md)
- **Site Properties API** (the site's time zone): [REST](https://dev.wix.com/docs/api-reference/business-management/site-properties/properties/get-site-properties.md)

| Step | Method | Endpoint |
|---|---|---|
| Site time zone | `GET` | `https://www.wixapis.com/site-properties/v4/properties?fields.paths=timeZone` |
| Find the model | `GET` | `https://www.wixapis.com/analytics/semantic-model/v3/semantic-models` |
| Query it | `POST` | `https://www.wixapis.com/analytics/semantic-model/v3/semantic-models/query-data` |

## Flow

1. **Get the site's time zone** from `properties.timeZone`:

   ```bash
   curl -X GET \
     'https://www.wixapis.com/site-properties/v4/properties?fields.paths=timeZone' \
     -H 'Authorization: <AUTH>'
   ```

2. **Find the model.** Call List Semantic Models and take the `id` of the model whose `slug` is `site-performace`, spelled that way: "performace", with no "n" before "ce". Its `description` and `keywords` are empty, so match on the slug. Never type the ID from memory; copy it from the List response.

   ```bash
   curl -X GET \
     'https://www.wixapis.com/analytics/semantic-model/v3/semantic-models' \
     -H 'Authorization: <AUTH>'
   ```

   Skip Get Semantic Model for this model. Its fields have no descriptions to choose by, and the field names in step 3 are the ones to send. This is the one exception to the List → Get → Query order in Query Site Analytics.

3. **Query once per device.** Mobile and desktop visitors have different experiences, so report them separately: send the query below with `deviceType` `Mobile`, then again with `Desktop`. Unless the user names a range, use the last 30 days with today included, the range the Site Speed dashboard shows.
   - `interval.timezone` is the site's time zone from step 1.
   - `start` and `end` are UTC instants that equal local midnight in that time zone, using the UTC offset for each date (it changes with daylight saving time). The example's site is in `Asia/Jerusalem`, UTC+2 on these dates, so local midnight is `22:00:00.000Z` on the day before.
   - The interval includes `start` and excludes `end`, so `end` is the local midnight after the last day you want. For the last 30 days with today included, `start` is local midnight 29 days before today and `end` is the local midnight after today. In the example, today is 2026-11-25.

   ```bash
   curl -X POST \
     'https://www.wixapis.com/analytics/semantic-model/v3/semantic-models/query-data' \
     -H 'Authorization: <AUTH>' \
     -H 'Content-Type: application/json' \
     -d '{
     "semanticModelId": "<id of site-performace from List>",
     "interval": {
       "start": "2026-10-26T22:00:00.000Z",
       "end": "2026-11-25T22:00:00.000Z",
       "timezone": "Asia/Jerusalem"
     },
     "fields": [
       "performance.dimension_name",
       "performance.dimension_value",
       "performance.page_views",
       "performance.crux_lcp",
       "performance.inp",
       "performance.crux_cls",
       "performance.fcp"
     ],
     "filters": [
       { "field": "timeframeGranularity", "values": ["DAY"] },
       { "field": "deviceType", "values": ["Mobile"] }
     ],
     "paging": { "limit": 1000, "offset": 0 }
   }'
   ```

4. **Split the rows by `performance.dimension_name`** (see *Reading the result*) and read the `total` row first.

5. **Rate each metric** by its p75 against the thresholds below, per device.

6. **Rank the slowest pages** by `crux_lcp__p75` from the `page_url_from` rows of the step 3 response; no extra query is needed. Make the filtered, sorted page query in *Before you begin* only when a response returned 1,000 rows, the page limit.

7. **Report**, per device:
   - the p75 and rating of LCP, INP and CLS, and which of them fail (Fair or Poor);
   - for each metric not rated Good, the share of page views that were Good;
   - the slowest pages, with their p75 and rating;
   - any day whose LCP or INP p75 has a worse rating than the `total` row's.

   Close with the Site Speed dashboard link: `https://manage.wix.com/dashboard/{metaSiteId}/analytics/performance/site-speed`, where `{metaSiteId}` is the site's ID, as in [Dashboard Navigation](https://dev.wix.com/docs/api-reference/business-solutions/bookings/skills/dashboard-navigation.md). The dashboard measures the same page views over the last 30 days, so its numbers come close to these but can differ slightly. Don't promise they will match exactly.

## Reading the result

One query returns three kinds of rows, told apart by `performance.dimension_name`:

| `dimension_name` | `dimension_value` | What the row is |
|---|---|---|
| `total` | `total` | The whole site for the interval and device. **Use this row for site-level numbers.** |
| `page_url_from` | a page path, e.g. `/` or `/blog` | One page. |
| `date_created` | a local day, `YYYY-MM-DD` | One day. |

Never add rows together: a page view counts once in `total`, once in its page row and once in its day row, so a sum over all rows triples it, and percentiles can't be summed or averaged at all. For any total, read the `total` row.

A response row looks like this:

```json
{
  "fields": {
    "performance.dimension_name": { "stringValue": "total" },
    "performance.dimension_value": { "stringValue": "total" },
    "performance.page_views": { "numericValue": 128 },
    "performance.crux_lcp": { "objectValue": { "crux_lcp__p75": 2400, "crux_lcp_good": 80.8696, "crux_lcp_need": 18.2609, "crux_lcp_poor": 0 } },
    "performance.inp": { "objectValue": { "inp__p75": 48, "inp_good": 100, "inp_need": 0, "inp_poor": 0 } },
    "performance.crux_cls": { "objectValue": { "crux_cls__p75": 0.0000394, "crux_cls_good": 100, "crux_cls_need": 0, "crux_cls_poor": 0 } },
    "performance.fcp": { "numericValue": 2284 }
  }
}
```

| Field | Value | Meaning |
|---|---|---|
| `performance.page_views` | number | Page views measured in the row. |
| `performance.crux_lcp` | object | Largest Contentful Paint: `crux_lcp__p75` in milliseconds; `crux_lcp_good`, `crux_lcp_need`, `crux_lcp_poor` are the percentages of page views rated Good, Fair (needs improvement) and Poor. |
| `performance.inp` | object | Interaction to Next Paint: `inp__p75` in milliseconds, plus `inp_good`, `inp_need`, `inp_poor`. |
| `performance.crux_cls` | object | Cumulative Layout Shift: `crux_cls__p75` (no unit), plus `crux_cls_good`, `crux_cls_need`, `crux_cls_poor`. |
| `performance.fcp` | number | First Contentful Paint p75, in milliseconds. Not a Core Web Vital: report it alongside them, but don't rate the site's Core Web Vitals on it. |

The p75 is the value 75% of page views were at or below. It's the number Core Web Vitals are rated on: a site passes a metric when its p75 is Good.

The three shares can add up to slightly more or less than 100, because Wix counts page views approximately. Report them as they are; don't rescale them.

## Thresholds

| Metric | Good | Fair (needs improvement) | Poor |
|---|---|---|---|
| LCP | ≤ 2500 ms | 2500–4000 ms | > 4000 ms |
| INP | ≤ 200 ms | 200–500 ms | > 500 ms |
| CLS | ≤ 0.1 | 0.1–0.25 | > 0.25 |

These are Google's Core Web Vitals thresholds ([web.dev](https://web.dev/articles/vitals)), the same ranges the Site Speed dashboard labels as Good, Fair and Poor. Show LCP and INP in seconds or milliseconds as the user reads them best, and CLS to two decimals.

## Before you begin (sharp edges)

- **Too little traffic means no rows, not zeros.** Pages and days with few page views get no row of their own, while their page views still count in `total`. In testing, pages under 10 page views and days under 4 had no row. A device with too little data in the interval returns no rows at all, not even `total`. The Site Speed dashboard similarly shows data only for sites with 10 or more sessions in the last 7 days. When a device comes back empty, tell the user there isn't enough real-visitor data for it in that range, and offer a longer range. Never report it as 0 ms or as fast.
- **A missing p75 means no data.** On a row where no visitor interacted with the page, `performance.inp` comes back as `{ "inp_good": 0, "inp_need": 0, "inp_poor": 0 }` with no `inp__p75`. Report INP as not measured for that row, not as 0 ms.
- **Parameters go in `filters`.** `deviceType` takes `All` (the default when it's omitted), `Desktop`, `Mobile` or `Tablet`, spelled exactly so; any other value fails with `400` `Invalid context filter value for deviceType`. The model also takes a `timeframeGranularity` parameter (`DAY`, `WEEK`, `MONTH`, `YEAR`): send `DAY`, as the Site Speed dashboard does. For a week or month figure, don't change it; query that week or month as its own interval and read its `total` row.
- **Only one kind of row:** add `{ "field": "performance.dimension_name", "values": ["page_url_from"] }` to `filters` to get just the pages (or `date_created` for just the days).
- **Slowest pages first, server-side** (only for more than 1,000 rows): with that page filter, sort on the metric object, which sorts by its p75: `"sort": { "fieldName": "performance.crux_lcp", "order": "DESC", "nullsLast": true }`.
- **`totalsIncluded` returns nothing for this model.** Read the `total` row instead.
- **Fields to leave out:** `performance.tti` always comes back empty, and `performance.fid_delay` is First Input Delay, which INP replaced as a Core Web Vital. Don't report either.
- **Answer from this model.** These are the site's real-visitor (field) numbers. Don't swap in a lab test, such as a PageSpeed or Lighthouse run, when the model has no data; that measures a simulated visit, not the site's visitors. If the user asks for a lab test as well, present it as a separate, simulated measurement.

## Example answer shape

```
Mobile, last 30 days (1,240 page views)
- LCP 2.9 s — Fair (61% of page views good)
- INP 140 ms — Good
- CLS 0.02 — Good
Slowest pages by LCP: /shop 3.8 s, /gallery 3.1 s
Desktop: all three Good (LCP 1.6 s, INP 40 ms, CLS 0.01)
Full picture: https://manage.wix.com/dashboard/{metaSiteId}/analytics/performance/site-speed
```

## Related Documentation

- [Query Site Analytics](https://dev.wix.com/docs/api-reference/business-management/analytics/skills/query-site-analytics.md): the general Semantic Model API recipe
- [Query Semantic Model Data](https://dev.wix.com/docs/api-reference/business-management/analytics/semantic-models/query-semantic-model-data.md)
- [List Semantic Models](https://dev.wix.com/docs/api-reference/business-management/analytics/semantic-models/list-semantic-models.md)
- [Get Site Properties](https://dev.wix.com/docs/api-reference/business-management/site-properties/properties/get-site-properties.md)
- [Understanding Your Site Speed Dashboard](https://support.wix.com/en/article/understanding-your-site-speed-dashboard)
- [Site Performance: About Core Web Vitals](https://support.wix.com/en/article/site-performance-about-core-web-vitals)