1.1.2 • Published 9 months ago

@skyanalytics/vue3 v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

SkyAnalytics Vue-3

SkyAnalytics Vue-3 is an adapter for SkyAnalytics that allows you to track your website's traffic and user behavior.

npm version

Installation

npm install @skyanalytics/vue3

Usage

import { createApp } from 'vue'
import analytics from '@skyanalytics/vue3'

const app = createApp({
  // ...
})

app.use(analytics, {
    key: 'source_key',
    host: 'http://localhost:3000',
	enabled: true // default is true
})

Directives

<button v-sk-analytics="{ event: 'click', data: { key: 'value' } }">Click me</button>

Methods

this.$skyAnalytics.event('event', { key: 'value' })

Composable

import { useAnalytics } from '@skyanalytics/vue3'

useAnalytics.event('event', { key: 'value' })
useAnalytics.navigate('page', { key: 'value' })
useAnalytics.metadata({ key: 'value' })

Vue-Router

import { createRouter } from 'vue-router'
import { useAnalytics } from '@skyanalytics/vue3'

const analytics = useAnalytics()

const router = createRouter({
  // ...
})

router.beforeEach((to, from, next) => {
  analytics.navigate(to.name)
  next()
})

!WARNING
Use with caution, the methods $skyAnalytics make sure that the instance is initialized and the plugin is enabled. Otherwise, it will throw an error.

1.1.2

9 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

1 year ago