nuxt-vercel-analytics

Nuxt module to integrate Vercel Analytics
12,952 22
Install
npm install nuxt-vercel-analytics
Latest Version:1.0.3
Vue:3
License:MIT
Last Updated:Aug 21, 2024
Links: GitHub  ·  npm
Maintainer: xanderbarkhatov

Nuxt Vercel Analytics

Nuxt Vercel Analytics

npm version npm downloads License Nuxt

Vercel Analytics integration for Nuxt

📝 Features

  • 🚀 Zero-config
  • 📥 Auto-imports

🔧 Setup

npx nuxi@latest module add vercel-analytics

That's it! Vercel Analytics is now integrated in your Nuxt app ✨

⚙️ Configuration

// app.config.ts
export default defineAppConfig({
  vercelAnalytics: {
    mode: "auto",
    debug: true,
    beforeSend: (event) => {
      if (event.url.includes("/private")) return null;

      return event;
    },
  },
});

📈 Custom Events

To track an event, call vercelTrack and pass in a string representing the event name as the first argument

const onSignup = () => {
  vercelTrack("Signup");
  // ...other logic
};

Custom data

You can also pass custom data along with an event by passing an object as the second argument

const onSignup = () => {
  vercelTrack("Signup", { location: "footer" });
  // ...other logic
};

Related Packages

@hexdigital/nuxt-segment

Nuxt 3 module for Segment

4,253 8
@nuxtjs/plausible

Natively integrates Plausible Analytics into Nuxt

468,286 120
@nathanchase/nuxt-dayjs-module

This is a Nuxt 3 compatible module built with the official Nuxt 3 (module-builde...

19,376 31
cap-socket

Functions developed by Cap to establish real-time and persistent communication w...

968
@brc-dd/nuxt-i18n

Minimal module for i18n with locale auto-imports & localized routing

898 12

Version History

Version Released Vue License
1.0.3 ^3.0 MIT
1.0.2 ^3.0 MIT
1.0.1 ^3.0 MIT
1.0.0 ^3.0 MIT
0.2.3 ^3.0 MIT