diff --git a/package-lock.json b/package-lock.json index 4b7faf7..f90b0dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,8 @@ "": { "name": "govuk-vue-docs", "dependencies": { - "govuk-vue": "1.0.0" + "govuk-vue": "1.0.0", + "vue-matomo": "^4.2.0" }, "devDependencies": { "@nuxt/content": "^2.6.0", @@ -11219,6 +11220,15 @@ "vue": ">=2" } }, + "node_modules/vue-matomo": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/vue-matomo/-/vue-matomo-4.2.0.tgz", + "integrity": "sha512-m5hCw7LH3wPDcERaF4sp/ojR9sEx7Rl8TpOyH/4jjQxMF2DuY/q5pO+i9o5Dx+BXLSa9+IQ0qhAbWYRyESQXmA==", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, "node_modules/vue-router": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.2.4.tgz", diff --git a/package.json b/package.json index 4a7d5b5..656ac9a 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "vue-docgen-cli": "^4.67.0" }, "dependencies": { - "govuk-vue": "1.0.0" + "govuk-vue": "1.0.0", + "vue-matomo": "^4.2.0" } } diff --git a/plugins/matomo.client.js b/plugins/matomo.client.js new file mode 100644 index 0000000..4b03e8b --- /dev/null +++ b/plugins/matomo.client.js @@ -0,0 +1,16 @@ +import { defineNuxtPlugin } from '#app' +import VueMatomo from 'vue-matomo' + +export default defineNuxtPlugin((nuxtApp) => { + nuxtApp.vueApp.use(VueMatomo, { + host: '//ambiph.one/analytics/', + siteId: 6, + // Enables automatically registering pageviews on the router + router: nuxtApp.$router, + enableLinkTracking: true, + requireConsent: false, + trackInitialView: true, + disableCookies: true, + requireCookieConsent: false, + }) +}) \ No newline at end of file