Skip to content

Install on Nuxt

View as Markdown

Add Reveata to a Nuxt app through app.head, with the script tag or the @reveata/next helper.

There are two ways to add Reveata to a Nuxt app; pick one.

Option 1: the script tag

No package to install. Add the script to app.head:

ts
// nuxt.config.ts
export default defineNuxtConfig({
  app: {
    head: {
      script: [
        {
          src: 'https://reveata.com/js/script.js',
          defer: true,
          'data-website-id': 'ws_your_tracking_id',
        },
      ],
    },
  },
});

Option 2: the @reveata/next helper

@reveata/next/snippet builds the same entry from options, with no React or Next dependency:

bash
npm install @reveata/next
ts
// nuxt.config.ts
import { nuxtHead } from '@reveata/next/snippet';

export default defineNuxtConfig({
  app: { head: nuxtHead({ websiteId: 'ws_your_tracking_id', host: 'https://reveata.com' }) },
});

With either option, route changes are tracked by the script. For goals, call window.reveata('goal', 'signup'), or use trackGoal from @reveata/next/client.

Was this helpful?