feat: add optional matomo tracking for pageviews and download

This commit is contained in:
2026-03-03 09:57:29 +00:00
parent 0d7ae8bbb7
commit 2f79c9e650
6 changed files with 95 additions and 7 deletions

View File

@@ -87,6 +87,22 @@
color: #4b5563;
}
</style>
{% if matomo_url and matomo_site_id %}
<script>
var _paq = window._paq = window._paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u = '{{ matomo_url }}/';
_paq.push(['setTrackerUrl', u + 'matomo.php']);
_paq.push(['setSiteId', '{{ matomo_site_id }}']);
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>
{% endif %}
</head>
<body>
<main class="wrap">