Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aleksdotbar/nuxt-vercel-analytics
Vercel Analytics integration for Nuxt
https://github.com/aleksdotbar/nuxt-vercel-analytics
analytics nuxt nuxt-module nuxtjs vercel vercel-analytics
Last synced: about 1 month ago
JSON representation
Vercel Analytics integration for Nuxt
- Host: GitHub
- URL: https://github.com/aleksdotbar/nuxt-vercel-analytics
- Owner: aleksdotbar
- License: mit
- Archived: true
- Created: 2023-03-30T13:53:30.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-21T16:07:50.000Z (5 months ago)
- Last Synced: 2024-11-30T19:40:36.057Z (about 1 month ago)
- Topics: analytics, nuxt, nuxt-module, nuxtjs, vercel, vercel-analytics
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/nuxt-vercel-analytics
- Size: 1.24 MB
- Stars: 22
- Watchers: 0
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
![Nuxt Vercel Analytics](https://raw.githubusercontent.com/xanderbarkhatov/nuxt-vercel-analytics/main/docs/cover.png)
# Nuxt Vercel Analytics
[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href]
[![Nuxt][nuxt-src]][nuxt-href]> [Vercel Analytics](https://vercel.com/docs/concepts/analytics) integration for Nuxt
## 📝 Features
- 🚀 Zero-config
- 📥 Auto-imports## 🔧 Setup
```bash
npx nuxi@latest module add vercel-analytics
```That's it! Vercel Analytics is now integrated in your Nuxt app ✨
## ⚙️ Configuration
```js
// 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
```js
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
```js
const onSignup = () => {
vercelTrack("Signup", { location: "footer" });
// ...other logic
};
```[npm-version-src]: https://img.shields.io/npm/v/nuxt-vercel-analytics/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-version-href]: https://npmjs.com/package/nuxt-vercel-analytics
[npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-vercel-analytics.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-downloads-href]: https://npmjs.com/package/nuxt-vercel-analytics
[license-src]: https://img.shields.io/npm/l/nuxt-vercel-analytics.svg?style=flat&colorA=18181B&colorB=28CF8D
[license-href]: https://npmjs.com/package/nuxt-vercel-analytics
[nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js
[nuxt-href]: https://nuxt.com