Skip to content

Plausible Widget

Visitor stats from Plausible Analytics, with a live count of who is on the site right now. Works with Plausible Cloud and with self-hosted Community Edition.

Requirements

A Plausible API key with stats access.

Getting an API key

  1. Sign in to your Plausible instance
  2. Go to Account Settings → API Keys → New API Key
  3. Give it a name and copy the key

The key is stored encrypted and is never sent back to the browser — see Security. Once saved, the field shows as saved rather than displaying the key.

Configuration

KeyTypeDefaultDescription
sitesSite[][]One or more sites, switchable from the widget
periodstring30dDefault period; changeable from the widget
topPageCountnumber5How many top pages to list (1–20)
refreshIntervalnumber300000Poll interval in ms

Each site:

KeyDescription
idGenerated automatically. Keeps the API key attached to this site rather than to its position in the list
nameDisplay name in the site picker. Falls back to the site ID
urlInstance base URL — https://plausible.io for Cloud, or your own
siteIdThe domain as registered in Plausible, e.g. example.com
apiKeyStored encrypted

What it shows

  • Live visitor count beside the period picker — visitors in the last five minutes, with a pulsing dot when anyone is on the site. It sits in the widget body rather than the title bar so it is still visible when the widget is placed inside a group, where title bars are hidden.
  • Visitors, pageviews, bounce rate and average visit duration for the selected period, each with the percentage change against the preceding period of the same length.
  • Top pages, linking through to the live page.

Change arrows are read in context: a falling bounce rate shows green, a falling visitor count shows red. Where Plausible has nothing to compare against — a new site, or a previous period with no traffic — the change shows as rather than 0%, which would claim something the API did not say.

Periods

These are Plausible's own, passed through unchanged:

OptionAPI value
Todayday
Last 7 days7d
Last 30 days30d
This monthmonth
Last 6 months6mo
Last 12 months12mo

Rate limits

Three API calls per refresh: the live count, the period aggregate, and the top pages. Only the selected site is fetched, so adding sites to the picker costs nothing extra.

Plausible Cloud allows 600 stats requests an hour. At the default five-minute refresh this widget uses 36 of them. Self-hosted instances have no limit by default.

Notes

API version. This uses the v1 Stats API (/api/v1/stats/…), which is available on Plausible Cloud and on every self-hosted release. The newer POST /api/v2/query needs a recent server and offers nothing this widget requires.

Site ID is a domain, not a URL. Enter example.com, not https://example.com. It must match exactly how the site is registered in Plausible.

If the live count is missing but the other figures are fine, the realtime endpoint failed on its own — the widget hides the count rather than showing a misleading zero, and the rest of the panel carries on.

Example config

json
{
  "period": "30d",
  "topPageCount": 5,
  "sites": [
    {
      "id": "b6f1…",
      "name": "Main site",
      "url": "https://plausible.example.com",
      "siteId": "example.com"
    }
  ]
}

Personal Homepage Dashboard