Switch from Umami to Piwik

This commit is contained in:
Korbs 2024-05-17 01:56:42 -04:00
parent f891e44dcc
commit 1e5eff3a17

View file

@ -3,9 +3,9 @@ const { Title, Description } = Astro.props;
// Don't count views in local environment
if (Astro.url.hostname === "localhost") {
var UseUmami = false;
var UsePiwik = false;
} else {
var UseUmami = true;
var UsePiwik = true;
}
---
@ -36,12 +36,20 @@ if (Astro.url.hostname === "localhost") {
<script type="module" src="/@shoelace-style/shoelace/cdn/shoelace.js"
></script>
{
UseUmami ? (
<script
defer
src="https://umami.sudovanilla.com/script.js"
data-website-id="a779721e-4bae-4520-9d77-8fd055cb0062"
/>
UsePiwik ? (
<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="//stats.sudovanilla.org/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
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>
) : null
}
</head>