Contents
On this page

Analytics Summary - Plugixa Chat

GET /plugixa-chat/v1/analytics/summary

Read the widget figures for a period: totals, the follow-through rate, one point per day and the ten busiest channels.

The signed-in user needs the plugixa_chat_view capability. Administrators have it.

Request

GET https://your-site.example/wp-json/plugixa-chat/v1/analytics/summary?days=30&widget=0

Query parameters

Name Type Default Description
days integer 30 How far back to look, 1 to 365.
widget integer 0 One widget’s figures. 0 is the whole site.

Responses

200 OK.

{
  "success": true,
  "data": {
    "days": 30,
    "totals": {
      "view": 1840,
      "open": 212,
      "click": 97
    },
    "clickRate": 45.8,
    "series": [
      {
        "date": "2026-10-14",
        "view": 61,
        "open": 8,
        "click": 3
      },
      {
        "date": "2026-11-12",
        "view": 58,
        "open": 6,
        "click": 4
      }
    ],
    "channels": [
      {
        "channel": "whatsapp",
        "hits": 70
      },
      {
        "channel": "phone",
        "hits": 27
      }
    ],
    "widget": 0
  }
}
Field Type Meaning
data.totals.view integer Pages where the launcher was shown
data.totals.open integer Times the menu was opened
data.totals.click integer Clicks on a channel
data.clickRate number Clicks per hundred opens, to one decimal. 0 when nothing was opened
data.series array One entry per day, oldest first, days entries long. Dates are UTC
data.channels array Clicks per channel slug, busiest first, at most ten
data.widget integer The widget asked for, 0 for all

Counts are kept per hour, in UTC. The totals start at midnight UTC days days ago, so they can include part of a day before the first entry of series.

Errors

Status Code When
400 rest_invalid_param days is outside 1 to 365, or widget is negative.

Plus the errors every endpoint can return.

Examples

curl -s "https://your-site.example/wp-json/plugixa-chat/v1/analytics/summary?days=30&widget=0" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$query = http_build_query([
    'days'   => 30,
    'widget' => 0,
]);
$ch = curl_init('https://your-site.example/wp-json/plugixa-chat/v1/analytics/summary?' . $query);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const query = new URLSearchParams({ days: '30', widget: '0' });
const response = await fetch(`https://your-site.example/wp-json/plugixa-chat/v1/analytics/summary?${query}`, {
  headers: {
    'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
  },
});
const { data } = await response.json();

Quick Links

Share