vue3-plausible
v1.0.0
Published
Plausible analytics implementation for Vue.js 3
Downloads
4
Maintainers
Readme
Plausible for Vue.js 3
This is a Vue.js 3 component for Plausible Analytics.
Installation
pnpm add vue3-plausible
npm install vue3-plausible
yarn add vue3-plausible
Usage
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