matomo for vue and basic tracking
This commit is contained in:
@@ -31,6 +31,7 @@
|
|||||||
"vee-validate": "^4.12.4",
|
"vee-validate": "^4.12.4",
|
||||||
"vue": "3.3.x",
|
"vue": "3.3.x",
|
||||||
"vue-google-charts": "^1.1.0",
|
"vue-google-charts": "^1.1.0",
|
||||||
|
"vue-matomo": "^4.2.0",
|
||||||
"vue-multiselect": "^3.0.0-beta.3",
|
"vue-multiselect": "^3.0.0-beta.3",
|
||||||
"vue3-easy-data-table": "^1.5.47",
|
"vue3-easy-data-table": "^1.5.47",
|
||||||
"vue3-multiselect-checkboxed": "^0.0.9",
|
"vue3-multiselect-checkboxed": "^0.0.9",
|
||||||
|
|||||||
@@ -390,6 +390,8 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
const showRow = async (item) => {
|
const showRow = async (item) => {
|
||||||
console.log("ITEM=", 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;
|
itemCode.value = item.code;
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { createInertiaApp, usePage } from '@inertiajs/inertia-vue3';
|
|||||||
import { InertiaProgress } from '@inertiajs/progress';
|
import { InertiaProgress } from '@inertiajs/progress';
|
||||||
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
|
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
|
||||||
import { ZiggyVue } from '../../vendor/tightenco/ziggy/dist/vue.m';
|
import { ZiggyVue } from '../../vendor/tightenco/ziggy/dist/vue.m';
|
||||||
|
import VueMatomo from 'vue-matomo';
|
||||||
import Themes from './themes'
|
import Themes from './themes'
|
||||||
import Swal from 'sweetalert2';
|
import Swal from 'sweetalert2';
|
||||||
import { Inertia } from '@inertiajs/inertia';
|
import { Inertia } from '@inertiajs/inertia';
|
||||||
@@ -30,6 +31,10 @@ createInertiaApp({
|
|||||||
return createApp({ render: () => h(app, props) })
|
return createApp({ render: () => h(app, props) })
|
||||||
.use(plugin)
|
.use(plugin)
|
||||||
.use(ZiggyVue, Ziggy)
|
.use(ZiggyVue, Ziggy)
|
||||||
|
.use(VueMatomo, {
|
||||||
|
host: 'https://matomo.soson.eu/',
|
||||||
|
siteId: '3',
|
||||||
|
})
|
||||||
.mixin({
|
.mixin({
|
||||||
methods: {
|
methods: {
|
||||||
...commons,
|
...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('start', commons.authorization)
|
||||||
Inertia.on('finish', commons.authorization)
|
Inertia.on('finish', commons.authorization)
|
||||||
Inertia.on('finish', () => {
|
Inertia.on('finish', () => {
|
||||||
|
|||||||
@@ -23,22 +23,6 @@
|
|||||||
@routes
|
@routes
|
||||||
@vite('resources/js/app.js')
|
@vite('resources/js/app.js')
|
||||||
@inertiaHead
|
@inertiaHead
|
||||||
|
|
||||||
<!-- Matomo -->
|
|
||||||
<script>
|
|
||||||
var _paq = window._paq = window._paq || [];
|
|
||||||
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
|
||||||
_paq.push(['trackPageView']);
|
|
||||||
_paq.push(['enableLinkTracking']);
|
|
||||||
(function() {
|
|
||||||
var u="https://matomo.soson.eu/";
|
|
||||||
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
|
||||||
_paq.push(['setSiteId', '3']);
|
|
||||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
|
||||||
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
<!-- End Matomo Code -->
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="font-sans antialiased bg-gray-100 relative min-h-screen">
|
<body class="font-sans antialiased bg-gray-100 relative min-h-screen">
|
||||||
|
|||||||
Reference in New Issue
Block a user