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

> ## Agent Instructions
> CrispStats is a hosted, privacy-first web analytics product. It has no self-hosted edition, no session replay, no heatmaps, no A/B testing, no mobile SDKs and no data import except a site's history from a Plausible export (Settings, Import and export).
> The script global is crispstats(...), site keys start with cs_pk_ and secret API keys start with cs_sk_. The script is served from https://in.crispstats.com/d.js and the REST API lives at https://crispstats.com/api/v1.
> There is no npm package to install. Integrations copy the script tag, the queue stub, crispstats.d.ts and proxy code from these docs or from Settings, Tracking code in the dashboard. A first-party proxy forwards one path of the site to https://in.crispstats.com/p/ and forwards only content-type, user-agent, accept-language, referer, origin, if-none-match and x-forwarded-for, never cookies.

# Show live numbers with widgets

> Put a live visitor count, a traffic figure, verified revenue, uptime or your Domain Rating on your own site, a GitHub README or a Notion page, in five styles, without tracking the people who see it.

A widget is one number from CrispStats, or a small card around it, that you paste on your own pages: the people on your site right now, visitors in the last 30 days, verified MRR, the uptime of a monitor or your Domain Rating. The figure stays current by itself, comes in five styles, and works as a script, an iframe, an image for a README, a shields.io badge or plain JSON. Nothing is public until an owner or admin of the site creates a widget, and a widget shows only the figures you chose.

![A card headed Visitors showing 72,082, up 23% against the previous 30 days, with a 30-day chart and the line Powered by CrispStats](https://mintcdn.com/crispstats/E7Fpqdyq9pa1UkLm/images/widgets/style-soft-light.png?fit=max\&auto=format\&n=E7Fpqdyq9pa1UkLm\&q=85\&s=f350ac232a48b15c09dfdbdbce8842b1)

Visitors card, soft style

![A card headed Domain Rating with a gauge at 43 of 100, up 3 in 30 days, a 90-day line, read today, and the line Domain Rating by Ahrefs](https://mintcdn.com/crispstats/E7Fpqdyq9pa1UkLm/images/widgets/dr-card-light.png?fit=max\&auto=format\&n=E7Fpqdyq9pa1UkLm\&q=85\&s=81063ad87aac72d4f050da0624107975)

Domain Rating card

## Create a widget

**1. Open the widgets screen**

Open your site, then **Settings** and the **Sharing and widgets** tab; the widgets are below the public dashboard. **Your widgets** lists the widgets of this site; **Add a widget** below it is a gallery of ready-made widgets, drawn with your own numbers.

**2. Pick one from the gallery**

The gallery is grouped by what the widget is for: **Show the crowd**, **Show growth**, **Prove revenue**, **Show reliability**, **Show authority** and **For READMEs and footers**. The **Style** and **Page** switches above it redraw every tile, so you can compare the same widget in each style on a light or a dark page. Tiles marked **Sample data** use demo numbers because this site has none for that widget yet.

**3. Adjust it**

Choose the layout, size, style, what it counts and over which range. The preview redraws on a light page, a dark page, a GitHub README or a 390 px phone screen. **What becomes public** lists, with today's values, everything anyone who sees the widget can read.

**4. Create it**

Select **Create widget**. Revenue and sales widgets first open **This will be public**: tick **I want to publish this** and select **Publish revenue**. See [Revenue and sales](https://docs.crispstats.com/share/widgets/revenue.md#consent).

**5. Copy the code**

Under **Code**, pick a tab (**HTML**, **iframe**, **README**, **Markdown**, **Notion**, **shields**, **React** or **JSON**) and copy it. **Where are you adding it?** gives one line for WordPress, Webflow, Framer, Shopify, Ghost and Carrd. Every form is on [Embed a widget](https://docs.crispstats.com/share/widgets/embed.md).

Only owners and admins can create, change, pause or delete widgets. Members can open the screen, preview every widget and copy the code of existing ones.

## What a widget can show

| Kind | Shows | Layouts |
| - | - | - |
| [Live visitors](https://docs.crispstats.com/share/widgets/live.md) | Visitors on the site in the last 5 minutes, with per-minute bars and top countries on the card | pill, card, badge |
| [Traffic figures](https://docs.crispstats.com/share/widgets/stat.md) | Visitors, pageviews, sessions or visitors from AI assistants over a range, with the change and a chart | pill, card, goal, badge |
| [Revenue](https://docs.crispstats.com/share/widgets/revenue.md) | Verified MRR or revenue, as a band, an exact figure, growth or "verified" only | pill, card, goal, badge |
| [Sales](https://docs.crispstats.com/share/widgets/revenue.md#sales) | The number of verified sales over a range | pill, card, badge |
| [Uptime](https://docs.crispstats.com/share/widgets/uptime.md) | The status and uptime of one monitor over 30 or 90 days | pill, strip, badge |
| [Domain Rating](https://docs.crispstats.com/share/widgets/domain-rating.md) | Your domain's Domain Rating from Ahrefs, its change and a 90-day line | pill, card, badge |
| [Site summary](https://docs.crispstats.com/share/widgets/site-summary.md) | Visitors in the last 30 days and your Domain Rating side by side, over a 30-day line, with our credit always shown | card |

![A card headed Live now showing 99, with one bar per minute for the last 30 minutes](https://mintcdn.com/crispstats/E7Fpqdyq9pa1UkLm/images/widgets/live-card-light.png?fit=max\&auto=format\&n=E7Fpqdyq9pa1UkLm\&q=85\&s=f92ebd640dd72263d946d00143dcc46e)

Live visitors card

![A card headed MRR showing \$10k+, up 10% against 30 days ago, with the footer Synced from 3 providers](https://mintcdn.com/crispstats/E7Fpqdyq9pa1UkLm/images/widgets/revenue-card-light.png?fit=max\&auto=format\&n=E7Fpqdyq9pa1UkLm\&q=85\&s=6539623fa7e252cac41a524959018b21)

Verified revenue card

![A strip headed Marketing site with All systems normal and one bar for each of the last 90 days, 100% uptime over 90 days](https://mintcdn.com/crispstats/E7Fpqdyq9pa1UkLm/images/widgets/uptime-strip-light.png?fit=max\&auto=format\&n=E7Fpqdyq9pa1UkLm\&q=85\&s=3f2e03249ea21109afbc232b78377d88)

90-day uptime strip

![A goal headed Road to 100,000 visitors with the bar at 72%](https://mintcdn.com/crispstats/E7Fpqdyq9pa1UkLm/images/widgets/growth-goal-light.png?fit=max\&auto=format\&n=E7Fpqdyq9pa1UkLm\&q=85\&s=41dfa11056fce4845a3fa71c86274432)

Growth goal

## Layouts and sizes

Each layout has three sizes. The snippet reserves the exact box before the data arrives, so nothing on your page moves when the widget loads. A pill fits its sentence inside that box, aligned to the start: a longer sentence gives way to a shorter one at a smaller size, such as `in 30 days` for `in the last 30 days`, and the full sentence stays in the widget's title for screen readers.

| Layout | Small | Medium | Large |
| - | - | - | - |
| Pill: one line | 220 × 32 px | 264 × 36 px | 320 × 44 px |
| Card: heading, figure, change and chart | 240 × 148 px | 320 × 176 px | 400 × 208 px |
| Goal: progress toward a target | 260 × 92 px | 320 × 104 px | 400 × 116 px |
| Strip: one bar per day | 260 × 84 px | 320 × 92 px | 400 × 100 px |
| Site summary card: two figures over a line | 320 × 160 px | 384 × 192 px | 480 × 240 px |

A badge is an image with a label on the left and the value on the right. It is 20 px tall in the **Flat** badge style, which matches shields.io, or 28 px in **Crisp**, which is rounder; its width follows the words.

Changing the layout or the size changes the box: copy the code again afterwards. Everything else, the style included, reaches the copies you already pasted.

## Styles

The style changes the surface, the edge and the shadow. Sizes, type and spacing stay the same, and the script, the iframe and the image all draw the same style. You can change it at any time without copying the code again.

### Soft

The default: a white card with a hairline and a soft shadow on light pages, a dark card on dark pages. It fits almost any page.

![Visitors card in the soft style on a light page: white surface, thin border, soft shadow](https://mintcdn.com/crispstats/E7Fpqdyq9pa1UkLm/images/widgets/style-soft-light.png?fit=max\&auto=format\&n=E7Fpqdyq9pa1UkLm\&q=85\&s=f350ac232a48b15c09dfdbdbce8842b1)

On a light page

![Visitors card in the soft style on a dark page: dark surface, thin light border](https://mintcdn.com/crispstats/E7Fpqdyq9pa1UkLm/images/widgets/style-soft-dark.png?fit=max\&auto=format\&n=E7Fpqdyq9pa1UkLm\&q=85\&s=4643d4f6aec1bb04d4c1058b0431b396)

On a dark page

### Outline

No fill, only the hairline. The page's own colour shows through, so it suits pages with a coloured background.

![Visitors card in the outline style on a light page: no fill, thin border](https://mintcdn.com/crispstats/E7Fpqdyq9pa1UkLm/images/widgets/style-outline-light.png?fit=max\&auto=format\&n=E7Fpqdyq9pa1UkLm\&q=85\&s=d9a69665ba5b6c32ce1c6f3939ffdbf5)

On a light page

![Visitors card in the outline style on a dark page](https://mintcdn.com/crispstats/E7Fpqdyq9pa1UkLm/images/widgets/style-outline-dark.png?fit=max\&auto=format\&n=E7Fpqdyq9pa1UkLm\&q=85\&s=33889663ad7cdf0d46fa71f9ff06838a)

On a dark page

### Solid

Inverted: a dark card on light pages and a white card on dark pages. The strongest signal for a small space.

![Visitors card in the solid style on a light page: dark surface with light text](https://mintcdn.com/crispstats/E7Fpqdyq9pa1UkLm/images/widgets/style-solid-light.png?fit=max\&auto=format\&n=E7Fpqdyq9pa1UkLm\&q=85\&s=c8eba364998b052add9b72f76156b10d)

On a light page

![Visitors card in the solid style on a dark page: white surface with dark text](https://mintcdn.com/crispstats/E7Fpqdyq9pa1UkLm/images/widgets/style-solid-dark.png?fit=max\&auto=format\&n=E7Fpqdyq9pa1UkLm\&q=85\&s=af9ae3ce8e978ca478b9acb8fabdf65c)

On a dark page

### Tint

The accent colour washed into the surface, with an accent hairline. Made for branded pages.

![Visitors card in the tint style on a light page: a pale orange surface with an orange border](https://mintcdn.com/crispstats/E7Fpqdyq9pa1UkLm/images/widgets/style-tint-light.png?fit=max\&auto=format\&n=E7Fpqdyq9pa1UkLm\&q=85\&s=3c8916982a0f06fd165ac9bc9b9f5484)

On a light page

![Visitors card in the tint style on a dark page: a dark brown surface with an orange border](https://mintcdn.com/crispstats/E7Fpqdyq9pa1UkLm/images/widgets/style-tint-dark.png?fit=max\&auto=format\&n=E7Fpqdyq9pa1UkLm\&q=85\&s=b7383ea36c14a6d7fbb14e0cc391fc1b)

On a dark page

### Plain

No surface at all: text and marks only, for footers and for numbers set inside your own copy.

![Visitors card in the plain style on a light page: text and chart only, no box](https://mintcdn.com/crispstats/E7Fpqdyq9pa1UkLm/images/widgets/style-plain-light.png?fit=max\&auto=format\&n=E7Fpqdyq9pa1UkLm\&q=85\&s=543e9ac0779db8a98e214bf3250d9367)

On a light page

![Visitors card in the plain style on a dark page](https://mintcdn.com/crispstats/E7Fpqdyq9pa1UkLm/images/widgets/style-plain-dark.png?fit=max\&auto=format\&n=E7Fpqdyq9pa1UkLm\&q=85\&s=b52dcb2966965bf997a8879ee7453bd3)

On a dark page

### Theme and accent

**Theme** is **Auto**, **Light** or **Dark**. On your pages, Auto follows the page the widget sits on, not the reader's system setting, so a light page stays light for a reader in dark mode. The script looks, in order, at:

1. a section under the widget with its own background, such as a dark footer;
2. the page's own theme switch: a `dark` or `light` class, or `data-theme`, `data-bs-theme`, `data-mode` or `data-color-mode`, on `<html>` or `<body>`, then a `color-scheme` that names one scheme;
3. the background of `<body>` or `<html>`.

It checks again when your page switches theme. To fix the theme on one copy, set `theme="light"` or `theme="dark"` on the element; to fix it everywhere, pick **Light** or **Dark** in the widget.

The iframe and the image cannot see the page they are on, so with Auto they follow the reader's system setting. In a README, the **README** form of the code shows the light or the dark image to match GitHub's theme.

**Accent** colours the marks only: the live dot, charts, bars, the goal bar and the Domain Rating gauge. Text always uses the style's own ink, so it stays readable. Pick **Orange**, **Ink**, **Blue**, **Green**, **Violet** or **Pink**, or enter a hex colour. A hex colour must reach a contrast of 3:1 on both a white and a dark card; a paler one is refused with "Pick a darker colour: this one fades on white or on dark." On the other styles' grounds the accent is deepened slightly where needed, so it never fades.

## Formats

The same widget can be pasted in several forms. [Embed a widget](https://docs.crispstats.com/share/widgets/embed.md) has the code for each.

| Kind | Script and element | iframe | Image (SVG) | shields.io | JSON |
| - | - | - | - | - | - |
| Live | pill, card | pill, card | pill, card, badge | yes | yes |
| Stat | pill, card, goal | pill, card, goal | every layout | yes | yes |
| Revenue | pill, card, goal | pill, card, goal | every layout; badges show a band or growth only | band or growth | yes |
| Sales | pill, card | pill, card | every layout | yes | yes |
| Uptime | pill, strip | pill, strip | every layout | yes | yes |
| Domain Rating | pill, card | pill, card | every layout | yes | yes, with the attribution as fields |
| Site summary | card | card | card | visitors only | yes, with the attribution as fields while a rating shows |

The script redraws the figure as it changes. Images and shields badges are pictures: proxies such as GitHub's image proxy cache them, so they lag a few minutes behind.

## Credit and attribution

Cards, goals and strips end with a small **Powered by CrispStats** link. Revenue and sales widgets say **Verified by CrispStats** instead and link to their [proof page](https://docs.crispstats.com/share/widgets/revenue.md#the-proof-page). On a pill the credit is the CrispStats mark at the end, with the same words as its title. The credit links to your [public dashboard](https://docs.crispstats.com/share/public-dashboard.md) when it is on, and to the CrispStats home page otherwise.

| Plan | Our credit |
| - | - |
| Trial | Always shown. |
| Starter, Growth, Scale | Optional on every widget except revenue, sales and the site summary: switch off **Credit** in the widget. |

On the [site summary](https://docs.crispstats.com/share/widgets/site-summary.md) our credit is part of the design and always shows. A Domain Rating widget always shows "Domain Rating by Ahrefs" next to the number, with "Ahrefs" linking to Ahrefs, on every plan and whatever the **Credit** switch says. Ahrefs' licence requires it. See [Domain Rating](https://docs.crispstats.com/share/widgets/domain-rating.md#attribution).

## What is public, and what never is

A widget exposes the figures of its own kind and settings and nothing else. **What becomes public** in the widget shows the exact list before you create it, for example:

* Visitors in the last 30 days (71,942)
* Change against the 30 days before
* A chart of the same period, as a shape
* Your site name and domain

These never leave CrispStats through a widget: your site id or public key, visitor ids, names or e-mail addresses (masked or not), cities or regions, IP addresses or anything derived from them, user agents, page paths, referrers, individual payments or amounts, refunds per customer, monitor URLs, self-reported payments from the [payment API](https://docs.crispstats.com/revenue/payment-api.md), test-mode payments, or payments in other currencies.

Small numbers are protected by floors:

* A live count between 1 and **Hide below** (default 3) shows "A few people online now", or nothing, never the number.
* A country appears on the live card only with at least 3 visitors; an AI assistant is named only with at least 3.
* A revenue figure appears only after 3 verified payments; before that the widget says "verified" without a number.
* A count of 0 hides the widget instead of showing "0".

### Nobody who sees a widget is tracked

The widget script and the iframe set no cookies, use no `localStorage`, `sessionStorage` or IndexedDB, send no beacons and carry no identifiers. They never call the collector's event endpoint and never count a pageview, on your site or anyone else's. The one request they make, for the widget's data, carries no cookies and no page address: only the host name a browser sends with every cross-site request. The collector uses the IP address of a request in memory only, to rate limit, and never stores it. For each widget, CrispStats keeps the time it was last loaded and the host name of the page it was loaded on, written at most once every 10 minutes, so **Your widgets** can say "Seen on quillbook.com · 4 min ago". Nothing else about the page or the reader is kept.

## Limits

Widgets count per workspace, across all of its sites. [Brand badges](https://docs.crispstats.com/share/widgets/brand-badge.md) are not widgets and do not count.

| | Trial | Starter | Growth | Scale |
| - | - | - | - | - |
| Widgets | 3 | 15 | 50 | 200 |
| Hide our credit | No | Yes | Yes | Yes |

At the limit, **Add a widget** is turned off with "Your plan includes 3 widgets." (with your plan's number) and a link to compare plans. Paused widgets count toward the limit too, so switching one on again never takes you past it.

If you move to a smaller plan, the oldest switched-on widgets up to the new plan's limit keep showing and the newer ones stop. Pause an older widget to let a newer one show instead. When the trial ends without a plan, or a paid plan ends, the workspace is [locked](https://docs.crispstats.com/account/plans-and-limits.md#when-the-trial-or-a-plan-ends) and every widget stops showing until you pick a plan. See [Plans and limits](https://docs.crispstats.com/account/plans-and-limits.md) and the [pricing page](https://crispstats.com/pricing).

## Pause, change or delete a widget

Each row in **Your widgets** has a switch and a menu.

| Action | What happens |
| - | - |
| Switch off | The widget is paused. Pages loaded from 3 minutes later no longer show it; switch it on to bring it back. |
| **Edit** | Opens the widget. Saved changes reach every copy within 3 minutes, styles and labels included. After a change of layout or size, copy the code again. |
| **Copy token** | Copies the widget's token, the `cs_wd_…` id in every snippet. |
| **Delete** | Removes the widget. Pages loaded from 3 minutes later no longer show it. This cannot be undone. |

A paused, deleted or unknown widget answers the same `404` everywhere, and the script removes it from your page without leaving a gap or a broken image. A page that is already open drops it at its next refresh: within a minute for a live count, within 10 minutes for the others. Images in a README and shields.io badges pass through caches that are not ours: GitHub's image proxy and shields.io keep their own copy for a few minutes, so those can take up to about 5 minutes longer. Copies and screenshots made by others can outlive a widget you delete.

**Allowed sites** limits where a widget may appear: enter up to 10 host names, or select **Only my sites**. Empty means anywhere.

| Entry | Matches |
| - | - |
| `quillbook.com` | That host only. `www.quillbook.com` is a different host. |
| `*.quillbook.com` | `quillbook.com` and every subdomain of it. |

The iframe enforces the list: a browser refuses to show it anywhere else. For the script and images the list stops casual copying, not a determined copier, because a request that names no page, such as GitHub's image proxy, is still answered. A page that hides its address, such as a sandboxed frame or a page opened from a file, cannot show a script widget that has a list; use the iframe there, or leave the list empty.

## Next steps

> [card] [Embed a widget](https://docs.crispstats.com/share/widgets/embed.md)
>
> Every form of the code: script, iframe, README, Notion, shields.io and React.

> [card] [Brand badge](https://docs.crispstats.com/share/widgets/brand-badge.md)
>
> "Powered by CrispStats" for any page or README, no account needed.

> [card] [Widget JSON](https://docs.crispstats.com/share/widgets/json-api.md)
>
> Read a widget's data and draw it yourself.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.