0.1.6 • Published 6 years ago
vue-piwik v0.1.6
VuePiwik
Link your Piwik/Matomo installation
Installation
npm install --save vue-piwik
Usage
Bundler (Webpack, Rollup)
import Vue from 'vue'
import VuePiwik from 'vue-piwik'
Vue.use(VuePiwik, {
host: 'https://matomo.example.com',
siteId: 5,
router: router // Enables automatically registering pageviews on the router
})
// Now you can access piwik api in components through
this.$piwik
// or
window._paq.push
// or through
window.Piwik.getTracker
For available operations see the piwik api docs
Browser
<!-- Include after Vue -->
<!-- Local files -->
<script src="vue-piwik/dist/vue-piwik.js"></script>
<!-- From CDN -->
<script src="https://unpkg.com/vue-piwik"></script>
Build
Bundle the js and css of to the dist
folder:
npm run build