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 - Built-in Search
- Atom Feeds - Atom Feeds
- PWA - PWA
- Google Analytics / GoatCounter - Web Analytics
- SEO & Performance Optimization - SEO & Performance Optimization
## Documentation ## Documentation

View file

@ -62,6 +62,12 @@ analytics:
id: # fill in your Google Analytics ID id: # fill in your Google Analytics ID
goatcounter: goatcounter:
id: # fill in your GoatCounter ID 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 settings
pageviews: 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>