Docs
Vue & Nuxt
One script tag covers the whole app, including Vue Router navigations. Takes about two minutes.
Vue (Vite)
Add the script to the index.html in your project root, just before </head>:
<script defer src="http://localhost:3000/analytics.js" data-website-id="YOUR_TRACKING_ID"></script>Nuxt
Add the script through nuxt.config.ts so it loads on every route:
export default defineNuxtConfig({
app: {
head: {
script: [
{
src: "http://localhost:3000/analytics.js",
defer: true,
"data-website-id": "YOUR_TRACKING_ID",
},
],
},
},
});Client-side routing
Nothing else to do. Vue Router navigations are tracked automatically through pushState, replaceState and popstate.
Track custom events
Call the global function from any component or page:
window.lumen?.("Signup", { plan: "pro" });Verify
Reload your site and open the site's real-time view in your dashboard. The pageview should appear within seconds. If not, see Troubleshooting.