matomo for vue and basic tracking
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
@@ -23,22 +23,6 @@
|
||||
@routes
|
||||
@vite('resources/js/app.js')
|
||||
@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>
|
||||
|
||||
<body class="font-sans antialiased bg-gray-100 relative min-h-screen">
|
||||
|
||||
Reference in New Issue
Block a user