Install guides / Vue and Nuxt

Add AnalyzeUser to Vue and Nuxt

Replace YOUR_SITE_ID with the site id from your project's setup screen.

  1. Vue with Vite: paste the tag inside <head> in index.html.
  2. Nuxt: add it to app.head.script in nuxt.config.ts, as below.
  3. Deploy. Router navigations count as pageviews.
// nuxt.config.ts
export default defineNuxtConfig({
  app: {
    head: {
      script: [{ src: "https://analyzeuser.com/track.js", defer: true, "data-site-id": "YOUR_SITE_ID" }],
    },
  },
});

To check it works, open your site in another browser (browsers you use the dashboard in are left out of your stats) and watch the dashboard's Online count. Next: custom events, revenue attribution, or proxying through your domain so ad blockers don't hide visitors.

Other code

Start free trial