Route changes are tracked for you
Nuxt apps navigate client side, so a plain page-view snippet only ever fires once. With trackScreenViews enabled the module follows Vue Router navigation and records each view as the user moves through the app.
GuidesWeb
Cookieless product analytics for Nuxt 3 and 4, with event data stored in Germany.
Privytics tracks page views, custom events and user profiles in your Nuxt app using the @openpanel/nuxt module. You register the module in nuxt.config.ts, point apiUrl at the Privytics ingestion endpoint, and route changes start being recorded without further wiring. Tracking is cookieless by default, so nothing is written to the visitor's device.
Nuxt apps navigate client side, so a plain page-view snippet only ever fires once. With trackScreenViews enabled the module follows Vue Router navigation and records each view as the user moves through the app.
useOpenPanel() is registered by the module, so any component can call op.track() without a provider wrapper, a plugin file, or an import statement. There is no context to thread through your layouts.
Nuxt ships its own Nitro server. You can track UI interactions from components and business events from server routes such as a completed checkout, so events that matter are not dependent on the browser.
The SDK sets no cookies and stores nothing on the visitor's device. That means no consent-state plumbing through your Nuxt plugins to decide whether the tracker may load.
About five minutes, on the free plan, without a credit card.
pnpm install @openpanel/nuxtAdd the module and configure it under the openpanel key. Set apiUrl explicitly, because the SDK otherwise defaults to OpenPanel's own host.
export default defineNuxtConfig({
modules: ['@openpanel/nuxt'],
openpanel: {
clientId: 'YOUR_CLIENT_ID',
apiUrl: 'https://api.privytics.com',
trackScreenViews: true,
trackOutgoingLinks: true,
trackAttributes: true,
},
});The useOpenPanel composable is auto-imported, so you can call it directly in any component.
<script setup>
const op = useOpenPanel(); // Auto-imported!
function handleClick() {
op.track('button_click', { button: 'signup' });
}
</script>
<template>
<button @click="handleClick">Trigger event</button>
</template>Call identify with your own user id to build a cross-session profile. This is opt-in and needs your own lawful basis, since it is no longer anonymous.
<script setup>
const op = useOpenPanel();
op.identify({
profileId: '123', // Required
firstName: 'Joe',
lastName: 'Doe',
email: 'joe@doe.com',
properties: {
tier: 'premium',
},
});
</script>Server-side tracking uses the @openpanel/sdk package with a client secret. Await the call inside an event handler so it completes before the function terminates.
import { OpenPanel } from '@openpanel/sdk';
const opServer = new OpenPanel({
clientId: 'YOUR_CLIENT_ID',
clientSecret: 'YOUR_CLIENT_SECRET',
apiUrl: 'https://api.privytics.com',
});
export default defineEventHandler(async (event) => {
// Await to ensure event is logged before function completes
await opServer.track('my_server_event', { foo: 'bar' });
return { message: 'Event logged!' };
});Privytics runs the open-source OpenPanel engine, so the upstream Nuxt SDK reference applies here too. Point apiUrl at Privytics and the data lands in your Privytics project.
Yes. The @openpanel/nuxt module declares nuxt ^3.0.0 || ^4.0.0 as a peer dependency, so the same module and config key work on both.
Yes, when trackScreenViews is enabled in your nuxt.config.ts. The module records a view on each client-side navigation, not just the initial load.
Yes. As well as useOpenPanel(), the module exposes the instance on the Nuxt app, so you can pull it out with const { $openpanel } = useNuxtApp() and call $openpanel.track() from anywhere with access to the Nuxt context.
The SDK sets no cookies and writes nothing to the device, so there is no storage access to consent to for the default cookieless tracking. You remain the data controller and should confirm your own obligations, particularly if you use identify() to build named profiles.
Event data is stored in EU data centres in Germany. Privytics is built on the open-source OpenPanel engine and is not affiliated with or endorsed by OpenPanel.