1.0.0 • Published 11 months ago

vue3-plausible v1.0.0

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

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