diff --git a/package.json b/package.json index 20186e8..41269e0 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "vee-validate": "^4.12.4", "vue": "3.3.x", "vue-google-charts": "^1.1.0", + "vue-matomo": "^4.2.0", "vue-multiselect": "^3.0.0-beta.3", "vue3-easy-data-table": "^1.5.47", "vue3-multiselect-checkboxed": "^0.0.9", diff --git a/resources/js/Pages/IkeaRoot.vue b/resources/js/Pages/IkeaRoot.vue index d527584..ef675ae 100644 --- a/resources/js/Pages/IkeaRoot.vue +++ b/resources/js/Pages/IkeaRoot.vue @@ -390,6 +390,8 @@ onMounted(() => { }); const showRow = async (item) => { console.log("ITEM=", item); + this.$matomo.trackEvent('Product', 'search', 'text', settingsStore.text); + this.$matomo.trackEvent('Product', 'click', 'code', item.globalCode); itemCode.value = item.code; try { diff --git a/resources/js/app.js b/resources/js/app.js index 7a4c2b2..096cc3a 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -6,6 +6,7 @@ import { createInertiaApp, usePage } from '@inertiajs/inertia-vue3'; import { InertiaProgress } from '@inertiajs/progress'; import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers'; import { ZiggyVue } from '../../vendor/tightenco/ziggy/dist/vue.m'; +import VueMatomo from 'vue-matomo'; import Themes from './themes' import Swal from 'sweetalert2'; import { Inertia } from '@inertiajs/inertia'; @@ -30,6 +31,10 @@ createInertiaApp({ return createApp({ render: () => h(app, props) }) .use(plugin) .use(ZiggyVue, Ziggy) + .use(VueMatomo, { + host: 'https://matomo.soson.eu/', + siteId: '3', + }) .mixin({ methods: { ...commons, @@ -55,6 +60,8 @@ const Toast = window.Toast = Swal.mixin({ } }) +window._paq.push(['trackPageView']); //To track pageview + Inertia.on('start', commons.authorization) Inertia.on('finish', commons.authorization) Inertia.on('finish', () => { diff --git a/resources/views/app.blade.php b/resources/views/app.blade.php index 5798d9b..37c953b 100644 --- a/resources/views/app.blade.php +++ b/resources/views/app.blade.php @@ -23,22 +23,6 @@ @routes @vite('resources/js/app.js') @inertiaHead - - - -