Nuxt renders on the server and navigates in the browser. Reveata's script handles both without a Nuxt module: you add it once to the document head through Nuxt's own configuration.
What you get
- Every page view, the first server-rendered one and each client-side route change after it.
- Goals from
window.reveata('goal', 'signup'), ortrackGoalfrom@reveata/next/client. - Revenue attribution by passing the visitor id to the server route that creates your checkout.
- The same options as any install: cookieless mode, extra domains, excluded paths, hash routes and a custom endpoint (install the script).
Two ways to install
A plain script entry in app.head, no package needed:
// 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' },
],
},
},
});The snippet helper: nuxtHead({ websiteId, host }) from @reveata/next/snippet builds the same entry from options. Despite the package name, the snippet export has no React or Next dependency, so it is safe in a Nuxt config. Nuxt's head configuration is documented in the Nuxt docs (opens in a new tab).
Linking payments to visits
Connect your payment provider in Reveata, then send window.reveata.metadata() from the page to the server route that creates the checkout, and copy the two ids into the checkout metadata. For Stripe that is metadata.reveata_visitor_id and metadata.reveata_session_id (Stripe Checkout attribution); the other providers take the same keys in their own custom data (connect a payment provider).
Your server route can also read the ids from Reveata's first-party cookies, _dt_v and _dt_s, keeping the part before the first dot. That works when the checkout starts from a plain form.