1.0.0 • Published 1 year ago
vue3-plausible v1.0.0
Plausible for Vue.js 3
This is a Vue.js 3 component for Plausible Analytics.
Installation
pnpm add vue3-plausiblenpm install vue3-plausibleyarn add vue3-plausibleUsage
import { createPlausible } from 'vue3-plausible';
const plausible = createPlausible({
init: {
domain: 'example.com',
apiHost: 'https://example.com',
trackLocalhost: true,
},
settings: {
enableAutoOutboundTracking: true,
enableAutoPageviews: true,
}
});
app.use(plausible);<script setup lang="ts">
const { trackEvent } = usePlausible();
</script>
<template>
<button @click="trackEvent('Click from Vue.js 3')">Click me</button>
</template>License
MIT License © 2024 ValDesign
1.0.0
1 year ago