Browse Source

Add matomo tracking code

Andrea Franceschini 2 years ago
parent
commit
4b7890d5c2
1 changed files with 19 additions and 2 deletions
  1. 19 2
      pages/_footer.php

+ 19 - 2
pages/_footer.php

@@ -29,14 +29,31 @@
 	</footer>
 
 	<!-- Global site tag (gtag.js) - Google Analytics -->
-	<script async src="https://www.googletagmanager.com/gtag/js?id=UA-1176762-5"></script>
+	<!-- <script async src="https://www.googletagmanager.com/gtag/js?id=UA-1176762-5"></script>
 	<script>
 	window.dataLayer = window.dataLayer || [];
 	function gtag(){dataLayer.push(arguments);}
 	gtag('js', new Date());
 
 	gtag('config', 'UA-1176762-5');
+	</script> -->
+	
+	<!-- Matomo -->
+	<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="https://matomo.morpheu5.net/";
+	    _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>
+	<!-- End Matomo Code -->
+	
 </body>
 
-</html>
+</html>