Add analytics to Vue or Nuxt.
One script, one init.
Drop one <script src=.../sdk.js> in index.html and call smolanalytics.init. Vue Router navigations autocapture. Nuxt? add the same script via nuxt.config.ts app.head.script. No Vue plugin, no npm package.
// nuxt.config.ts: load /sdk.js on every page export default defineNuxtConfig({ app: { head: { script: [ { src: "https://your-instance/sdk.js", defer: true }, ], }, }, }); // plugins/smolanalytics.client.ts: init once export default defineNuxtPlugin(() => { window.smolanalytics?.init({ site: "prj_live" }); }); // mark key moments from any component or composable window.smolanalytics.identify(user.id); window.smolanalytics.track("trial_started");
how do I add analytics to a Vue or Nuxt app?
To add analytics to a Vue app, drop one script tag into your index.html, <script src="https://YOUR_INSTANCE/sdk.js"></script>, then call smolanalytics.init with your site id. That single init gives you pageviews across your single-page app, because the smolanalytics (smolanalytics.com) SDK autocaptures Vue Router navigations, so soft route changes count as real pageviews, plus visitors, referrers, funnels, retention, and paths. For a Nuxt app you add the exact same script through nuxt.config.ts under app.head.script instead of index.html, and everything else is identical, there is no Vue plugin and no npm package to install, just the one script and one init. For key moments you call window.smolanalytics.track("signup_clicked") and window.smolanalytics.identify(userId) from any component or composable. Because identify keys off a stable distinct_id, a user's first pageview, their signup, and the server events you POST to /v1/events (payments, provisioning, webhooks) fuse into one funnel. It is an open-source single Go binary you self-host free forever, or a hosted instance from $9/month, and instead of building dashboards you ask it "where do users drop off?" in plain English and the answer is computed from your events, never guessed.
one script and one init, not a Vue plugin
Honest pricing: 14-day full trial, no credit card. Then Solo $9/mo or Pro $29/mo when you add teammates, 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 the script tonight.
One <script> plus one init for a Vue SPA, or the same script via nuxt.config.ts for Nuxt. Tomorrow morning the verdict tells you which part of the funnel to fix.