# What is happening on your site, as it happens.

Realtime analytics shows who is on your site right now: a live count, visitors per minute for the last half hour, the pages being read and where people came from. Pageviews, events and payments stream in without a refresh.

Try it on sample data: [Realtime in the demo](/app/demo/realtime)

## The count you check first

The number at the top is the people on your site in the last five minutes. Under it, a bar for each of the last thirty minutes shows whether that number is rising or fading, so a spike from a post or a newsletter is obvious the moment it starts.

The pages being read right now are ranked beside it. When a link is shared somewhere, you see which page it points to before you see where it was shared.

## Every arrival, event and payment

The feed lists what visitors do as they do it: who arrived and from where, which pages they open, the custom events you send, and payments the moment a webhook lands. Each row names the city, the page and the source.

It is the quickest test there is. Deploy a signup button, click it, and watch the event arrive a second later.

- Pageviews, custom events and payments in one stream
- Sources of the people online, ranked as they change
- Updates pushed over a WebSocket, no polling

## Built to stay up under a spike

Each site has its own realtime hub at the edge, on Cloudflare Durable Objects. The script answers with no delay and the work happens after the response, so a sudden crowd on your site never waits on CrispStats.

The dashboard view and the stored reports are fed from the same events, so the live numbers and the daily numbers line up.

## One tag. Realtime is on from the first pageview.

1. **Add the script.** Paste it into your site's head. Every page load is in the feed within seconds.

```html
<script
  defer
  data-site="cs_pk_your_site_key"
  data-domains="example.com"
  src="https://in.crispstats.com/d.js"
></script>
```

2. **Send the events you care about.** Call the global with a name and flat props. The event shows in the feed and counts toward goals and funnels.

```js
// Anywhere in your code
crispstats("signup", { plan: "pro" });
```

3. **Keep the tab open.** The realtime page keeps a connection open and updates in place. Close it and nothing is lost: the same events are in your reports.

## Frequently asked questions

### How quickly does an event show up?

Usually within a second or two of it happening. The script sends it with a beacon, the edge answers at once, and the realtime hub pushes it to every open dashboard.

### What counts as online?

Anyone with an event in the last five minutes. When five minutes pass without one, they leave the count.

### Does realtime cost extra events?

No. The realtime view shows the events you already send. Only pageviews and custom events count toward your plan, and watching them is free.

### Can my team watch it at the same time?

Yes. Every member of the site who opens the realtime page gets the same live stream.

### Can I show the live count publicly?

Yes. A public dashboard can show the number of visitors online, and a small public endpoint returns the count for a badge on your own site. Both are off until you turn them on.
