@skyanalytics/nuxt
v1.0.5
Published
SkyAnalytics NUXT is an adapter for [SkyAnalytics]
Downloads
9
Readme
SkyAnalytics Nuxt
SkyAnalytics Nuxt is an adapter for SkyAnalytics that allows you to track your website's traffic and user behavior.
Installation
npm install @skyanalytics/nuxt
// `nuxt.config.ts`
export default defineNuxtConfig({
modules: ['@skyanalytics/nuxt'],
skyanalytics: {
key: 'source_key',
host: 'http://localhost:3000',
},
});
Module options
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
.
Usage
Directives
<button v-sk-analytics="{ event: 'click', data: { key: 'value' } }">Click me</button>
Composable
const analytics = useAnalytics()
function send() {
analytics.event('event_name', { key: 'value' })
}