nuxt-vercel-analytics
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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
};

Package Sidebar

Install

npm i nuxt-vercel-analytics

Weekly Downloads

414

Version

1.0.2

License

MIT

Unpacked Size

8.17 kB

Total Files

12

Last publish

Collaborators

  • xanderbarkhatov