123456789101112131415161718192021222324252627 |
- // <noscript><p><img src="https://matomo.morpheu5.net/matomo.php?idsite=1&rec=1" style="border:0;" alt="" /></p></noscript>
- import { ConsentStore } from "~~/types";
- export default defineNuxtPlugin(_nuxtApp => {
- const consentStore = useCookie('consent-store').value as ConsentStore;
- const analytics = consentStore?.analytics;
- if (analytics) {
- const u = "https://matomo.morpheu5.net/";
- const _paq = window._paq = window._paq || [];
- _paq.push(['trackPageView']);
- _paq.push(['enableLinkTracking']);
- _paq.push(['setTrackerUrl', `${u}matomo.php`]);
- _paq.push(['setSiteId', process.dev ? '3' : '1']);
-
- useHead({
- script: [
- {
- src: `${u}matomo.js`,
- body: true,
- async: true,
- }
- ]
- });
- }
- });
|