Event analytics at ridiculous scale.
Cookieless pageviews and custom events from a 3 KB script. A thin ingest path, a queue, and TimescaleDB rollups behind it, built to take ten thousand events a second.
- 3 KB script
- No cookies
- Self-hostable
- MIT licensed
Built on boring, well-understood parts
- TypeScript
- Node.js
- Express
- Redis
- PostgreSQL
- Timescale
- Next.js
- React
- Tailwind CSS
- Docker
Live view · demo data
Every dot is a pageview. None of them is a person.
1 / s
One pageview.
A visitor in Berlin opens your pricing page. One GET request, one 204 back.
- Events per second
- 1
- Today
- 0
Everything you need.Nothing that follows people around.
Pageviews, referrers, devices, countries, custom events, and a box that answers questions about your traffic in plain English.
| country | pageviews |
|---|---|
| IN | 1,284 |
| US | 962 |
| DE | 411 |
Ask your data a question.
The model writes the SQL, never runs it. A parser checks it's one read-only SELECT scoped to your site.
- /pricingDEnow
- /docs/quickstartIN4s
- /US9s
Who's on the site right now.
A live count and event feed, streamed over server-sent events.
No cookies, no stored IPs.
The IP is used once for the country, then dropped.
Built for single-page apps.
A React hook. Route changes count as pageviews.
Track clicks with one attribute.
Add data-pulse-event to any element, or call trackEvent.
- Cookies set
- 0
- Every ingest reply
- 0
- Rows per insert
- 0
- Target, load test pending
- 0k/s
By the numbers.
10k/s is the design target until the load test runs.
Follow one pageview from click to chart.
Step 1 of 6 · Browser
Your site sends an event.
Every orange dot is one pageview leaving a visitor's browser. The 3 KB script sends the path, referrer and screen size, and sets no cookies.
- One pageview
Time since the visitor clicked
0.0 ms
Three moving parts.One of them is in a hurry.
The request path only accepts the event. Everything slow happens later, in a worker your visitors never wait on.
The request does almost nothing.
Validate, look the site up in a Redis cache, rate-limit per site and per IP, put the event on a BullMQ queue, return 204. Parsing and geo lookups wait for the worker.
- Stage
- Ingest · 1 of 3
- Runs
- In the request · 4.8 ms p90
- Stack
- Express · Redis · BullMQ
- Key line
- L14–15 · Enqueue, then answer 204
ingestion/track.controller.tsexport const track = async (req, res) => { const parsed = TrackQuerySchema.safeParse(req.query) if (!parsed.success) return res.status(204).send() const site = await getCachedSite(parsed.data.tid) if (!site) return res.status(204).send() const [perSite, perIp] = await Promise.all([ checkSiteRateLimit(site.id, site.rateLimitTier), checkIpRateLimit(extractClientIp(req)), ]) if (!perSite.allowed || !perIp.allowed) return res.status(204).send() await enqueue(buildRawEvent(parsed.data, req, site.id)) res.status(204).send() // always 204, errors never reach the page }A worker writes in batches.
The worker parses the user agent, looks up the country, then drops the IP. Rows go to the database 100 at a time. If the database is down it holds the batch and retries. A row the database rejects goes to a dead-letter queue, so one bad event can't block the rest.
- Stage
- Process · 2 of 3
- Runs
- In a worker · within 1 s
- Stack
- BullMQ worker · TimescaleDB
- Key line
- L9 · One insert per 100 events
workers/event.worker.tsconst BATCH_SIZE = 100 const FLUSH_INTERVAL_MS = 1000 async function flushBatch() { const toFlush = batch batch = [] try { await insertManyEvents(toFlush) } catch (err) { if (isPermanentWriteError(err)) { await isolateAndQuarantine(toFlush) // bad rows → DLQ return } batch = [...toFlush, ...batch] // transient: keep, retry scheduleFlusher() } }Charts read rollups, not raw events.
TimescaleDB keeps hourly rollups up to date in the background, so a 30-day chart adds up a few hundred rows instead of scanning every event.
- Stage
- Query · 3 of 3
- Runs
- When a chart loads
- Stack
- TimescaleDB · Next.js
- Key line
- L4 · Read the hourly rollup
analytics/analytics.repository.tsSELECT COALESCE(NULLIF(referrer, ''), 'Direct') AS source, SUM(pageviews)::int AS pageviews FROM hourly_pageviews -- continuous aggregate WHERE "siteId" = $1 AND bucket >= $2 AND bucket < $3 GROUP BY 1 ORDER BY pageviews DESC LIMIT $4
Two minutesto your first pageview.
- 01
Create a site
Sign in, add a site, and copy its tracking ID. The ID is public, like any analytics tag.
- 02
Paste one script tag
Put it in the <head>. It's 3 KB and sends the pageview as soon as it loads. Use npm instead if you prefer.
- 03
Load a page
The realtime count in the dashboard updates within a few seconds.
<!-- Pulse Analytics -->
<script
src="https://pulse.yourdomain.com/pulse.js"
data-tid="pk-8f2c41a9d7e04b6fa1c35d8e92b74a06"
data-host="https://pulse.yourdomain.com"
></script>Swap in the tracking ID from your site's settings.
See your traffic.Leave your visitors alone.
Open source and MIT licensed. Run it on your own box, or sign up and try it here.
npm install @akdevv/pulse