index.html · open source (MIT) · ask in plain English

Add analytics to SolidJS.

SolidJS renders through fine-grained reactivity with no virtual DOM, so instrumentation should stay out of your signals and effects. smolanalytics is two script tags in your Vite index.html, autocapturing pageviews, clicks, scroll and JS errors with zero code. Ask your numbers in plain English rather than wiring event tracking into every component.

index.html
<!-- index.html at the project root (Vite Solid), inside <head> -->
<head>
  <!-- ...existing head... -->
  <script src="https://YOUR-INSTANCE/sdk.js"></script>
  <script>smolanalytics.init("WRITE_KEY", { host: "https://YOUR-INSTANCE" })</script>
</head>

<!-- SolidStart: put the same two tags in the <head> of src/entry-server.tsx instead -->

Plain Solid apps use the Vite index.html at the root. On SolidStart the document head lives in src/entry-server.tsx, so add the tags there.

how do I add analytics to solidjs?

SolidJS renders through fine-grained reactivity with no virtual DOM, so instrumentation should stay out of your signals and effects. smolanalytics is two script tags in your Vite index.html, autocapturing pageviews, clicks, scroll and JS errors with zero code. Ask your numbers in plain English rather than wiring event tracking into every component.

With Solid the reactivity is fine-grained, so a lot of your UI updates in place without a route change. Autocapture still captures the clicks, scroll and rage or dead clicks that reveal where a component is confusing, plus any JS errors your effects throw. When a signal-driven flow completes, call smolanalytics.track("plan_selected", { plan: "pro" }) directly, and identify(userId) once auth resolves.

It fits Solid because it never touches the reactive graph. The tags load in the HTML shell before your app mounts, so there is nothing to memoize or clean up in an effect. Self-host the open-source binary free or run it hosted from 29 dollars a month, keep it cookieless with no consent banner, and query it in plain English from the dashboard or your editor.

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 SolidJS 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 SolidJS?
SolidJS renders through fine-grained reactivity with no virtual DOM, so instrumentation should stay out of your signals and effects. smolanalytics is two script tags in your Vite index.html, autocapturing pageviews, clicks, scroll and JS errors with zero code. Ask your numbers in plain English rather than wiring event tracking into every component.
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