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
- Sign in to your Plausible instance
- Go to Account Settings → API Keys → New API Key
- 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
| Key | Type | Default | Description |
|---|---|---|---|
sites | Site[] | [] | One or more sites, switchable from the widget |
period | string | 30d | Default period; changeable from the widget |
topPageCount | number | 5 | How many top pages to list (1–20) |
refreshInterval | number | 300000 | Poll interval in ms |
Each site:
| Key | Description |
|---|---|
id | Generated automatically. Keeps the API key attached to this site rather than to its position in the list |
name | Display name in the site picker. Falls back to the site ID |
url | Instance base URL — https://plausible.io for Cloud, or your own |
siteId | The domain as registered in Plausible, e.g. example.com |
apiKey | Stored 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:
| Option | API value |
|---|---|
| Today | day |
| Last 7 days | 7d |
| Last 30 days | 30d |
| This month | month |
| Last 6 months | 6mo |
| Last 12 months | 12mo |
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
{
"period": "30d",
"topPageCount": 5,
"sites": [
{
"id": "b6f1…",
"name": "Main site",
"url": "https://plausible.example.com",
"siteId": "example.com"
}
]
}