Site configuration > Build & deploy > Snippet injection (or root <head>) · open source (MIT) · ask in plain English

Add analytics to a Netlify site Netlify.

smolanalytics is open-source web analytics you can add to any Netlify site without touching your build. Netlify has a native Snippet injection field that pastes markup before </head> on every page, so the two smolanalytics script tags go straight there. It autocaptures pageviews, clicks, scroll and JS errors with zero code.

Site configuration > Build & deploy > Snippet injection (or root <head>)
<!-- Netlify: Site configuration > Snippet injection > Insert before </head> -->
<script src="https://YOUR-INSTANCE/sdk.js"></script>
<script>smolanalytics.init("WRITE_KEY", { host: "https://YOUR-INSTANCE" })</script>

Snippet injection applies site-wide with no redeploy. If you'd rather commit it, drop the same two tags in your framework's root layout or index.html head.

how do I add analytics to netlify?

smolanalytics is open-source web analytics you can add to any Netlify site without touching your build. Netlify has a native Snippet injection field that pastes markup before </head> on every page, so the two smolanalytics script tags go straight there. It autocaptures pageviews, clicks, scroll and JS errors with zero code.

Netlify's Snippet injection is the cleanest path here: it's a real built-in field that injects your markup before </head> on every response, so you get smolanalytics live across the whole site without a rebuild or a code change. That's useful when the site is a static export or built by someone else and you just want tracking on fast.

Once it's in, autocapture covers pageviews, clicks with element chains, rage and dead clicks, and form submits. It's cookieless so no consent banner, and the whole thing is a single open-source Go binary you can self-host free or run hosted from $29/mo. Ask "top pages and where people rage-click" from the dashboard or your editor over MCP.

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 Netlify tonight.

One snippet, or one endpoint. Tomorrow morning the verdict tells you which part of the funnel to fix.

questions

How do I add analytics to Netlify?
smolanalytics is open-source web analytics you can add to any Netlify site without touching your build. Netlify has a native Snippet injection field that pastes markup before </head> on every page, so the two smolanalytics script tags go straight there. It autocaptures pageviews, clicks, scroll and JS errors with zero code.
Do I need a cookie banner?
Not in cookieless mode. smolanalytics can run without storing anything on the device, so there is no consent banner to add. You still get visitors, referrers, funnels, retention, and paths, and AI-assistant referrals (chatgpt.com, claude.ai, perplexity.ai) show up as their own channel.
Is it enough for a real product, or just page counts?
It does funnels, retention, paths, cohorts, and a daily verdict on what to fix, from the same events, and you ask it in plain English. It deliberately skips session replay, feature flags, and experiments. If you want a straight answer on what to fix, that you own and can self-host free, it fits.

keep reading