> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maxicore.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Analytics abilities: traffic, views, and conversions

> Query page view counts, traffic sources, UTM data, and WooCommerce product conversion rates with Maxi AI Core analytics abilities. Requires Pro plan.

Analytics abilities give your AI agent access to page view data, traffic source breakdowns, UTM attribution, and WooCommerce conversion rates. Both abilities require the **Pro plan** and depend on the **Maxi Web Analytics** plugin being active on your site for local (`server`) tracking.

## All analytics abilities

| Ability                          | Description                                                                                                                                                 | Capability       | Plan |
| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | ---- |
| `maxi/get-analytics`             | **\[PRO]** Query page view analytics. Report types: `views`, `top-posts`, `sources`, `conversions`. Supports date ranges, time grouping, and result limits. | `manage_options` | Pro  |
| `maxi/manage-analytics-settings` | **\[PRO]** View or update analytics configuration. Set the analytics provider and check provider availability status.                                       | `manage_options` | Pro  |

## maxi/get-analytics

Use `maxi/get-analytics` to pull structured analytics data from your site. Select one of four report types depending on what you need.

### Report types

<AccordionGroup>
  <Accordion title="top-posts — most viewed posts">
    Returns a ranked list of posts by total view count within a date range. Filter by post type and control how many results you receive.

    ```json theme={null}
    {
      "report_type": "top-posts",
      "post_type": "post",
      "date_after": "2025-01-01",
      "date_before": "2025-12-31",
      "limit": 10
    }
    ```
  </Accordion>

  <Accordion title="views — time-grouped views for a post">
    Returns total or time-grouped view counts for a specific post. Group by `day`, `week`, or `month` to see trends over time.

    ```json theme={null}
    {
      "report_type": "views",
      "post_id": 123,
      "group_by": "day",
      "date_after": "2025-01-01"
    }
    ```
  </Accordion>

  <Accordion title="sources — traffic source breakdown">
    Returns a breakdown of traffic sources with referrer domains and UTM parameter data (source, medium, campaign).

    ```json theme={null}
    {
      "report_type": "sources",
      "date_after": "2025-01-01"
    }
    ```
  </Accordion>

  <Accordion title="conversions — view-to-purchase rates">
    Returns view-to-purchase conversion rates for WooCommerce products. Requires WooCommerce to be active. Matches product page views against completed orders for the same period.

    ```json theme={null}
    {
      "report_type": "conversions",
      "date_after": "2025-01-01",
      "date_before": "2025-12-31"
    }
    ```
  </Accordion>
</AccordionGroup>

## maxi/manage-analytics-settings

View or update your analytics configuration. Use the `get` action to check the current provider and its availability status.

```json theme={null}
{ "action": "get" }
```

Switch to a different provider with the `update` action:

```json theme={null}
{
  "action": "update",
  "provider": "server"
}
```

### Providers

| Provider | Description                                                                                                 | Status                                      |
| -------- | ----------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
| `server` | Local tracking via the Maxi Web Analytics plugin. Data stays on your server with no third-party dependency. | Available when Maxi Web Analytics is active |
| `ga4`    | Google Analytics 4 integration.                                                                             | Coming soon                                 |

<Note>
  The `server` provider requires the **Maxi Web Analytics** plugin to be installed and active on your site. If it is not active, `maxi/get-analytics` returns an error indicating the provider is unavailable.
</Note>

## WooCommerce revenue analysis

There are no dedicated WooCommerce analytics abilities for revenue totals, top-selling products, or order trends. To answer those questions, use `maxi/list-orders` with date filters and compute the metrics from the returned order data. For per-product sales counts, read the `total_sales` meta key via `maxi/get-meta` on the product.

<Tip>
  Combine `maxi/get-analytics` (for traffic and conversion rates) with `maxi/list-orders` (for revenue and order data) to get a complete picture of your store's performance in a single session.
</Tip>
