Vue & Nuxt

The cleanest way to add a third-party script in Nuxt is through nuxt.config.ts. Open the file and add a script entry to app.head:

// nuxt.config.ts
export default defineNuxtConfig({
  app: {
    head: {
      script: [
        {
          src: "https://api.snowanalytics.app/sa.js",
          defer: true,
          "data-site": "YOUR_SITE_ID",
        },
      ],
    },
  },
});

Nuxt injects this into the <head> of every page for you.

SPA route tracking

No router hooks needed. Snow hooks the browser History API automatically, so Vue Router navigations are tracked without any extra code. See Single-page apps.

Verify

Open your site in a browser, then check the Live view in the Snow dashboard. See Troubleshooting if nothing appears.

On this page