12345678910111213141516171819202122232425262728 |
- // <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 || true) {
- const u = "https://matomo.morpheu5.net/";
- const _paq = window._paq = window._paq || [];
- _paq.push(['requireCookieConsent']);
- _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,
- }
- ]
- });
- }
- });
|