// 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, } ] }); } });