Skip to content
Docs
Changelog

First-party analytics in the admin, counted without cookies

Page, screen and event counts kept by our own server without cookies or identifiers, rolled up by the cron, and shown on /admin/analytics with a Bklit chart, annotations and optional Cloudflare numbers.

Markdown

  • Counting without cookies. POST /api/events, the analytics relay, counts page views from the site and the web app and screen views from the mobile app: the path without its query (except utm_*), or the route pattern on signed-in screens and in the app, the referrer's host, the country from the edge and device and browser codes. No cookie, storage, IP address, user agent or id is kept; bots and automated browsers count nothing. The web client is about 0.8 KB gzip and starts after hydration. A database rate limit keyed by an HMAC of the address works on Node as on Workers. Mixpanel or PostHog can be added later as providers that only receive batches sent with consent; none ships (18a7aff6, 4555bb3d, 149735df). Confirm the cookieless counting with your data protection owner before launch. Analytics explains what is kept and why.
  • Totals in Postgres, folded by the cron. Raw events live for 30 days; the one-minute tick folds them into daily tables exactly once under a lease and a watermark, writes one release annotation per new Worker version, and, with CLOUDFLARE_ANALYTICS_TOKEN and CLOUDFLARE_ANALYTICS_ZONE_ID, syncs Cloudflare's zone totals every 30 minutes. Every analytics table denies the tenant role, proved in the RLS matrix (d404855c).
  • Days in your time zone. ANALYTICS_TIME_ZONE (an IANA name such as America/Sao_Paulo, UTC when unset) cuts the days of the rollup, the raw retention, the admin page and the Cloudflare sync's window, daylight saving time included. Changing it is safe at any time: the new zone starts at its next midnight, days already counted keep their hours, nothing is counted twice, and the admin page notes the switch. Cloudflare's own numbers stay on Cloudflare's UTC dates, and the CF card says so (3ec1df1a, bb4e786e, 08816323). Days and the time zone.
  • /admin/analytics. Platform admins see the period's views, events, countries, active sources, the share with consent and Cloudflare's unique visitors (both dimmed, the latter marked "CF"), views per day stacked by source with imported days hatched, release markers and campaign bands, annotations they can add or delete, and the top pages, countries, referrers and events (4555bb3d, 97c35587).
  • Bklit charts in packages/ui. The first Bklit components in the template: the composed chart, markers, reference area and sparkline, with motion 14.14.0 and d3-array, d3-scale and d3-shape; the chart roles are theme tokens (47163f57). Bundle cost: docs/measurements/2026-11-27-admin-analytics.md.
Edit on GitHubDocumentation is in English.
Cookie settings
We use essential cookies to make our app work. With your consent, we also use optional cookies to improve your experience.

Read our Cookie Policy and Privacy Policy.