in.crispstats.com, the collector filters and enriches it at the edge and shows it to anyone watching the live view, and the event is then written to storage, where your reports read it. A visit appears in the live view within seconds and in the overview charts about a minute later. This page explains each stage so you know why numbers can lag, why some requests are never counted, and how visitors and sessions are defined.
The path of an event
The same path applies to every event the script sends: pageviews, engagement pings, custom events, revenue, identify calls, web vitals and errors.1
The script sends the event
The script builds a small payload: the site’s public key, the page URL, the referrer, the screen width, the browser language, the timezone name and a timestamp. The URL fragment is sent only when the script has
data-hash. The script sends the payload to https://in.crispstats.com/e with navigator.sendBeacon, or fetch with keepalive when the beacon is unavailable or refused. The body is JSON sent as text/plain, so the browser makes no preflight request, and the script never reads the response. By default the script sets no cookie and writes nothing to the device.2
The collector answers 202 at once
The collector reads the body and replies
202 Accepted before it looks up the site or does any other work, so tracking never slows your page. The rest happens after the response. Because of this, an unknown key, a bot, a paused site or a payload that fails validation all get the same empty 202. The only browser-facing errors are 400 for a body that is not a JSON object and 413 for a body over 16 KB.3
The collector filters the request
These requests are dropped without a trace:
- AI crawlers. They are never counted as visits, only when your server reports them (see AI crawlers).
- Bots, headless browsers, HTTP clients, prerender and prefetch requests, and requests without a User-Agent, according to the site’s bot filtering level.
- Events from a hostname the site does not allow, from an excluded path or from an excluded IP address. See exclude traffic.
- Events for an unknown key or a paused or suspended site.
- Events for a workspace in its trial that has reached its 25,000 events this month. It is paused until a plan starts or the next month begins.
- Events for a workspace that is locked because it has no plan after its trial or plan ended.
- Anything over the rate limit of 1,200 requests per 60 seconds from one address at one edge location.
4
The collector enriches the event
The collector derives the visitor id from the IP address and User-Agent, reads the device type, browser and operating system from the User-Agent, and estimates the location from the connection, with coordinates rounded to 0.1 degree. It then discards the IP address and User-Agent: neither is stored or logged.It also cleans the page URL: by default query strings are removed from the stored path, duplicate and trailing slashes are normalised, and a fragment that starts with
#/ or #!/ is kept as a hash route (the script sends the fragment only with data-hash). UTM parameters are read before the query string is removed, and the referrer and UTM tags are classified into a traffic channel.5
The site's realtime hub assigns a session
Each site has one realtime hub. It decides whether the event continues the visitor’s current session or starts a new one, updates who is online, and pushes the event to every open realtime view of the site. This is why the realtime screen shows a visit within seconds.If the hub cannot be reached, the event is still stored. It gets a session id derived from the visitor id and a 30-minute time bucket, so it still groups into a visit.
6
The event is written to storage
Events are written in batches of up to 100, or whatever arrived within 5 seconds. A failed write is retried with backoff, and delivery is at least once: the database ignores an event it has already stored. Each batch also updates the visit it belongs to (entry page, exit page, pageviews, duration, source) and, for engagement pings, the time on page and scroll depth of the pageview. Pings themselves are not stored as events.
7
Rollups are refreshed and reports read them
Every minute, CrispStats recomputes hourly and daily totals for each hour that received events. Reports without filters read these totals, so the overview charts and tables trail live data by about a minute. Reports with a filter, such as a country or a page, read the stored visits directly. So do reports for sites with persistent visitors and reports viewed in a timezone other than the site’s.
Expected delays
If a visit is in the live view but not yet in the overview, wait a minute and reload. If it never appears in the live view, the request was most likely filtered or blocked before it reached the collector. Troubleshooting covers the common causes.
Visitors
A visitor is an anonymous id, not a person. By default the collector computes it as the first 32 hex characters of a SHA-256 hash of a daily random salt, the site id, the IP address and the User-Agent. The salt changes at the start of each day in the site’s timezone. The old salt is kept for 35 minutes after its day ends so open sessions can finish, then deleted, so yesterday’s ids cannot be recomputed or linked to today’s. This has two consequences for counting:- One browser is one visitor per day. The same person on two devices, or on two networks in the same day, counts as two visitors.
- Visitors add up across days. Someone who visits on Monday and on Tuesday counts as one visitor each day, and as two visitors in a report for the whole week.
localStorage and sends it with each event, and the collector hashes it with the site id. Returning visitors are then recognised across days, and a report over a date range counts each id once. This stores an identifier on the visitor’s device, so read that page before you turn it on.
Events from your server with a secret API key carry no IP address or User-Agent. They join a visit only when you pass a visitor id you got from crispstats.id() earlier and that visit is still open, within 30 minutes of its last event. See server-side events.
Sessions
A session is one visit: a run of events from the same visitor. A new session starts when either of these happens:- 30 minutes of inactivity. The next event after 30 minutes without one starts a new session.
- A new campaign or referrer. A pageview that arrives through a different source, channel or
utm_campaignthan the one the session started with starts a new session, even within 30 minutes. Direct arrivals never split a session. Navigation within one hostname does not either, because a referrer on the page’s own hostname, or a subdomain of it, counts as direct. A link from your domain to a page on one of its subdomains, such as fromexample.comtoblog.example.com, counts as a referral and starts a new session.
Presence
A visitor is online while they have sent an event in the last 5 minutes. The realtime screen, the live card on the overview and the live visitor badge all use this window. When 5 minutes pass without an event, the visitor leaves the live view and the feed shows the end of their visit. While someone has the realtime view open, the online count is refreshed every 5 seconds. Presence and sessions use different windows. A visitor who reads one page for 10 minutes without scrolling to a new page sends no events while reading, so they drop out of the live view after 5 minutes. When they leave the page, the script sends a ping, and that ping still belongs to the same session because it arrived within 30 minutes.Revenue
Payments reach CrispStats in two ways: from the payment providers you connect with a key, which CrispStats reads back from each provider’s API (by webhook where the provider sends one, and by a regular check), and revenue events sent withcrispstats.revenue() or from your server with a secret API key (see the payment API). Each payment is attributed to the first visit of the customer who paid, found through the visitor id you pass at checkout or the user id you set with crispstats.identify(). A renewal or refund that arrives without a visitor reuses the attribution of the same customer’s first payment, matched by email address. If the paying visitor’s session is still open, within 30 minutes of their last event, the payment also appears in the live feed at once. See revenue attribution.
Learn more on crispstats.com
- Features: realtime and the live globe are the live view this page describes.
- Glossary: visitor hash, session and bot traffic.
Next steps
Metrics explained
How visitors, bounce rate, visit duration, conversion rate and channels are calculated.
Cookieless tracking
The privacy model behind the daily visitor id.
Collector API
The endpoints behind
/e, /id and /bot.