Add analytics to Cloudflare Pages.
smolanalytics is open-source analytics for sites deployed on Cloudflare Pages. Pages serves your built static output, so the two script tags go in your root HTML head, index.html or your framework's root layout before it builds. It autocaptures pageviews, clicks, engagement, scroll and JS errors with zero code, cookieless by default.
<!-- In your root HTML <head>, before the build that Pages serves -->
<script src="https://YOUR-INSTANCE/sdk.js"></script>
<script>smolanalytics.init("WRITE_KEY", { host: "https://YOUR-INSTANCE" })</script>Cloudflare Pages has no built-in snippet field, so add the tags to your source head. For advanced setups you could inject via a Pages Function or Worker HTMLRewriter, but the head is simpler.
how do I add analytics to cloudflare pages?
smolanalytics is open-source analytics for sites deployed on Cloudflare Pages. Pages serves your built static output, so the two script tags go in your root HTML head, index.html or your framework's root layout before it builds. It autocaptures pageviews, clicks, engagement, scroll and JS errors with zero code, cookieless by default.
Cloudflare Pages just serves whatever your build outputs, so there's no dashboard injection point, the smolanalytics tags belong in your source HTML head or your framework's root layout. After the next deploy, autocapture starts recording pageviews and clicks across every route with no further wiring.
Running it here pairs well with Cloudflare's edge: your pages stay fast, and analytics is a lightweight script plus your own instance holding the raw events. It's cookieless so you avoid a consent banner, and answers are deterministic computed reports, not an AI guessing over your data. Self-host the Go binary free or use hosted from $29/mo. Track custom events with smolanalytics.track("signup", { plan: "pro" }).
Honest pricing: 14-day full trial, no credit card. Then Solo $29/mo, never metered on seats or sites. Overage is $5/million with an emailed receipt, the dashboard never locks, and self-hosting the single Go binary is free forever (MIT).
Add analytics to Cloudflare Pages tonight.
One snippet, or one endpoint. Tomorrow morning the verdict tells you which part of the funnel to fix.