feat(analytics): add Umami and Matomo tracking codes (#1658)

This commit is contained in:
Filippo 2024-04-09 16:57:06 +02:00 committed by GitHub
parent 23be4162b3
commit 61bdca2db4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 27 additions and 1 deletions

View File

@ -36,7 +36,7 @@
- Built-in Search
- Atom Feeds
- PWA
- Google Analytics / GoatCounter
- Web Analytics
- SEO & Performance Optimization
## Documentation

View File

@ -62,6 +62,12 @@ analytics:
id: # fill in your Google Analytics ID
goatcounter:
id: # fill in your GoatCounter ID
umami:
id: # fill in your Umami ID
domain: # fill in your Umami domain
matomo:
id: # fill in your Matomo ID
domain: # fill in your Matomo domain
# Pageviews settings
pageviews:

View File

@ -0,0 +1,14 @@
<!-- Matomo -->
<script type="text/javascript">
var _paq = window._paq = window._paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//{{ site.analytics.matomo.domain }}/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', {{ site.analytics.matomo.id }}]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->

View File

@ -0,0 +1,6 @@
<!-- Umami -->
<script
defer
src="{{ site.analytics.umami.domain }}/script.js"
data-website-id="{{ site.analytics.umami.id }}"
></script>