Skip to content

Commit

Permalink
added matomo js tracking snippet only on prod env
Browse files Browse the repository at this point in the history
  • Loading branch information
qtrinh2 committed Jan 24, 2025
1 parent 5469662 commit 7c7e157
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,25 @@
<link type="application/atom+xml" rel="alternate" href="{{ site.url }}/articles.xml"
title="Current Research in Digital History - Articles Feed" />

{% if site.env == "prod" %}
<!-- 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://stats.rrchnm.org/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '36']);
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 -->
{% else %}
<!-- No Matomo -->
{% endif %}
</head>

<body>

0 comments on commit 7c7e157

Please sign in to comment.