SkyAnalytics Nuxt is an adapter for SkyAnalytics that allows you to track your website's traffic and user behavior.
npm install @skyanalytics/nuxt
// `nuxt.config.ts`
export default defineNuxtConfig({
modules: ['@skyanalytics/nuxt'],
skyanalytics: {
key: 'source_key',
host: 'http://localhost:3000',
},
});
-
key
- The source key of your SkyAnalytics instance. -
host
- The host of your SkyAnalytics instance. -
captureNavigation
- Capture navigation events automatically. Default:true
. -
enabled
- Enable or disable tracking. Default:true
.
<button v-sk-analytics="{ event: 'click', data: { key: 'value' } }">Click me</button>
const analytics = useAnalytics()
function send() {
analytics.event('event_name', { key: 'value' })
}