Add analytics to SvelteKit.
SvelteKit ships fast, hydrated pages across SSR and CSR, so your analytics has to catch navigations the router does without a full reload. smolanalytics drops in as two script tags in src/app.html, autocaptures pageviews, clicks, scroll and JS errors with zero code, and lets you ask your numbers in plain English from the dashboard or your editor.
<!-- src/app.html, inside <head> ... %sveltekit.head% lives here too -->
<head>
<!-- ...existing head... -->
<script src="https://YOUR-INSTANCE/sdk.js"></script>
<script>smolanalytics.init("WRITE_KEY", { host: "https://YOUR-INSTANCE" })</script>
</head>src/app.html is the one HTML shell every SvelteKit route renders into, so both tags load once and client-side navigations get captured automatically.
how do I add analytics to sveltekit?
SvelteKit ships fast, hydrated pages across SSR and CSR, so your analytics has to catch navigations the router does without a full reload. smolanalytics drops in as two script tags in src/app.html, autocaptures pageviews, clicks, scroll and JS errors with zero code, and lets you ask your numbers in plain English from the dashboard or your editor.
In SvelteKit the thing worth measuring is client-side navigation, form actions, and the load-function boundary between server and client. Autocapture handles the pageviews and clicks for free, so start by watching which routes people actually reach and where rage or dead clicks pile up. For the moments that matter, call smolanalytics.track("signup", { plan: "pro" }) inside your form action or an onMount, and identify(userId) once the session resolves.
It fits SvelteKit because there is no build step or adapter to fight. The two tags sit in src/app.html and load on every route whether it rendered on the server or the client. It is one open-source Go binary you can self-host free or run hosted from 29 dollars a month, cookieless so you skip the consent banner, and every answer it gives you is a deterministic report a CI test proves it can't hallucinate.
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 SvelteKit tonight.
One snippet, or one endpoint. Tomorrow morning the verdict tells you which part of the funnel to fix.