<template>
  <!-- intentionally empty -->
</template>

<script setup>
import { onMounted } from 'vue'

const isLocalhost = window.location.hostname === 'localhost'

// Umami nur aktivieren, wenn NICHT localhost
if (import.meta.client && !isLocalhost) {
  useHead({
    meta: [
      {
        name: 'google-site-verification',
        content: 'wJJ_1ptqt3xz0TsEpWpDczyV4rY5mAh9_np9TFbVcL8'
      }
    ],
    script: [
      {
        src: 'https://umami.digimedialoop.de/script.js',
        defer: true,
        'data-website-id': '7f521c0f-28b8-4ca8-82bf-150a34e14da6'
      }
    ]
  })

  // Matomo Tracking-Skript dynamisch einfügen
  onMounted(() => {
    const _paq = (window._paq = window._paq || [])
    _paq.push(["setDocumentTitle", document.domain + "/" + document.title])
    _paq.push(["setCookieDomain", "*.digimedialoop.de"])
    _paq.push(["disableCookies"])
    _paq.push(["trackPageView"])
    _paq.push(["enableLinkTracking"])
    _paq.push(["setTrackerUrl", "//analytics.digimedialoop.de/matomo.php"])
    _paq.push(["setSiteId", "1"])

    const script = document.createElement("script")
    script.src = "//analytics.digimedialoop.de/matomo.js"
    script.async = true
    document.head.appendChild(script)
  })
}
</script>
