Nuxt
Install
npm install @antlytics/nuxt
Usage
Register the module and add your tracking ID in nuxt.config.ts:
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['@antlytics/nuxt'],
antlytics: {
trackingId: 'YOUR_TRACKING_ID',
},
})
The module automatically injects a client-side plugin that:
- Sends a pageview on initial load (
app:mounted) - Sends a pageview on every route change via Vue Router's
afterEachhook
Options
| Option | Required | Default | Description |
|---|---|---|---|
trackingId | Yes | — | UUID from Antlytics → Sites |
apiHost | No | https://www.antlytics.com | Use your own first-party proxy |
Verify data is flowing
Start your dev server (nuxt dev) and open the app in a browser. Check the real-time count in your Antlytics dashboard — data appears within seconds.
See Troubleshooting for common issues.
Something missing? Get in touch and we will update these docs.