From 5f0098a3db916da92efcea8b8a7db8b93c45f876 Mon Sep 17 00:00:00 2001 From: Antonio Vivace Date: Sun, 17 Dec 2023 23:14:48 +0100 Subject: [PATCH] add matomo tracking --- package.json | 3 ++- plugins/matomo.client.js | 18 ++++++++++++++++++ yarn.lock | 5 +++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 plugins/matomo.client.js diff --git a/package.json b/package.json index b7273cf1fa..c97d4dcfeb 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "primeicons": "5.0.0", "primevue": "^3.30.0", "sass": "^1.51.0", - "sitemap": "^7.1.1" + "sitemap": "^7.1.1", + "vue-matomo": "^4.2.0" }, "license": "GPL-3.0-only" } diff --git a/plugins/matomo.client.js b/plugins/matomo.client.js new file mode 100644 index 0000000000..1c947cfad9 --- /dev/null +++ b/plugins/matomo.client.js @@ -0,0 +1,18 @@ +// This plugin is auto-discovered by Nuxt + +import { defineNuxtPlugin } from '#app' +import VueMatomo from 'vue-matomo' + +export default defineNuxtPlugin((nuxtApp) => { + nuxtApp.vueApp.use(VueMatomo, { + host: 'https://stats.gbdev.io', + siteId: 1, + // 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 diff --git a/yarn.lock b/yarn.lock index b6ad99a00d..4c13c1f8c6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4283,6 +4283,11 @@ vue-devtools-stub@^0.1.0: resolved "https://registry.yarnpkg.com/vue-devtools-stub/-/vue-devtools-stub-0.1.0.tgz#a65b9485edecd4273cedcb8102c739b83add2c81" integrity sha512-RutnB7X8c5hjq39NceArgXg28WZtZpGc3+J16ljMiYnFhKvd8hITxSWQSQ5bvldxMDU6gG5mkxl1MTQLXckVSQ== +vue-matomo@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/vue-matomo/-/vue-matomo-4.2.0.tgz#d65e369e4ead1d95ef790bef3627512cac3d25e9" + integrity sha512-m5hCw7LH3wPDcERaF4sp/ojR9sEx7Rl8TpOyH/4jjQxMF2DuY/q5pO+i9o5Dx+BXLSa9+IQ0qhAbWYRyESQXmA== + vue-router@^4.2.3: version "4.2.4" resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-4.2.4.tgz#382467a7e2923e6a85f015d081e1508052c191b9"