Skip to main content

Instance analytics stats

The Gateway reports visits for an Instance that publishes a tracking host. The report comes from the fleet analytics driver, which reads the Plausible Community Edition Stats API of the analytics role. The driver reads community-edition stats directly from the Stats API. Analytics role owns the role, the tracking host, and the Stats API key.

Read the stats

GET /api/v1/instances/{instance}/analytics/stats returns one report. The Orbit web Instance page shows it. The CLI and the PHP SDK have no counterpart for this read.

Know when the panel is available

The Gateway reports stats as available when both of these are true. The web page fetches this report on the Instance view. It draws the panel only when available is true. An Instance without tracking, or a fleet without an active analytics role, has no panel.

Know how the Gateway reads it

The Plausible Community Edition driver calls the Stats API on the analytics Node over WireGuard, at the published Plausible port. It sends the stored Stats API key as a bearer token. It never uses a public URL and never returns the key. The site is the Instance’s authoritative public domain. That is the data-domain in the tracking snippet. The request cannot name another site. The driver asks Plausible for realtime visitors, visitor totals for day, 7d, and 30d, and a 30-day page breakdown limited to ten rows. If any of those calls fails, the whole read is unreadable. The Gateway does not mix a successful count with a missing one.

Handle a failed read

An unavailable report is available: false. That is not an error. A failed read of an available report is HTTP 200 with readable: false. The response never contains visitor numbers in that case, so a missing key cannot look like an empty site.