Install Statsdot on Nuxt
Updated October 17, 2026
Add the script to app.head in nuxt.config.ts:
export default defineNuxtConfig({
app: {
head: {
script: [
{ src: 'https://statsdot.com/js/script.js', defer: true, 'data-domain': 'yoursite.com' },
],
},
},
})
Nuxt's router changes the address with the history API, which Statsdot listens to, so every page counts.
Track events from a component with window.statsdot?.track('Signup'), or add data-statsdot-event="Signup" to a button, link or form.