Skip to content

Commit 7c7e157

Browse files
committed
added matomo js tracking snippet only on prod env
1 parent 5469662 commit 7c7e157

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

_includes/head.html

+19
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,25 @@
3535
<link type="application/atom+xml" rel="alternate" href="{{ site.url }}/articles.xml"
3636
title="Current Research in Digital History - Articles Feed" />
3737

38+
{% if site.env == "prod" %}
39+
<!-- Matomo -->
40+
<script>
41+
var _paq = window._paq = window._paq || [];
42+
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
43+
_paq.push(['trackPageView']);
44+
_paq.push(['enableLinkTracking']);
45+
(function() {
46+
var u="https://stats.rrchnm.org/";
47+
_paq.push(['setTrackerUrl', u+'matomo.php']);
48+
_paq.push(['setSiteId', '36']);
49+
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
50+
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
51+
})();
52+
</script>
53+
<!-- End Matomo Code -->
54+
{% else %}
55+
<!-- No Matomo -->
56+
{% endif %}
3857
</head>
3958

4059
<body>

0 commit comments

Comments
 (0)