Sfoglia il codice sorgente

Add matomo tracking code

Andrea Franceschini 2 anni fa
parent
commit
4b7890d5c2
1 ha cambiato i file con 19 aggiunte e 2 eliminazioni
  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>