GuidesWeb

Nuxt analytics, cookieless and hosted in the EU

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.

Why Nuxt teams use Privytics

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.

The composable is auto-imported

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.

Client and server events from one app

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.

No cookie plumbing to add

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.

Set it up

About five minutes, on the free plan, without a credit card.

  1. Install the module

    pnpm install @openpanel/nuxt
  2. Register it in nuxt.config.ts

    Add 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,
      },
    });
  3. Track an event

    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>
  4. Identify a user

    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>
  5. Track server events from Nitro

    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.

Questions

Does this work with Nuxt 4?

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.

Does it track route changes automatically?

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.

Can I reach the tracker outside a composable?

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.

Do I need a cookie banner for this?

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.

Where is the data stored?

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.