Add Matomo tracking code

This commit is contained in:
Dorian Niemiec 2024-04-24 18:22:37 +02:00
parent 7761af0a0f
commit 3b9fbad1af
2 changed files with 19 additions and 0 deletions

View file

@ -47,6 +47,7 @@ recent_posts_limits: 5
# Miscellaneous # Miscellaneous
google_analytics: google_analytics:
gauges_analytics: gauges_analytics:
matomo: true
favicon: /favicon.ico favicon: /favicon.ico
links: true links: true
twitter: twitter:

View file

@ -43,4 +43,22 @@
<% if (theme.links) {%> <% if (theme.links) {%>
<%- css('https://cdn.jsdelivr.net/npm/fork-awesome@1.2.0/css/fork-awesome.min.css') %> <%- css('https://cdn.jsdelivr.net/npm/fork-awesome@1.2.0/css/fork-awesome.min.css') %>
<% } %> <% } %>
<% if (theme.matomo) {%>
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(["disableCookies"]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//analytics.svrjs.org/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '2']);
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>
<!-- End Matomo Code -->
<% } %>
</head> </head>