Skip to content

Commit

Permalink
chore(analytics): add matomo analytics to prod builds (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
insectengine authored Aug 4, 2023
1 parent 2c91f01 commit 5138aa5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions _includes/rh-analytics-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
{% endif %}
{% if jekyll.environment == "production" %}
<script id="dpal" src="https://www.redhat.com/ma/dpal.js" type="text/javascript"></script>
<script src="{{ site.baseurl }}/assets/javascript/tracking.js"></script>
<script src="https://analytics.ossupstream.org/matomo.js" async defer></script>
{% endif %}
8 changes: 8 additions & 0 deletions assets/javascript/tracking.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
var idSite = 6;
var matomoTrackingApiUrl = 'https://analytics.ossupstream.org/matomo.php';

var _paq = window._paq = window._paq || [];
_paq.push(['setTrackerUrl', matomoTrackingApiUrl]);
_paq.push(['setSiteId', idSite]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);

0 comments on commit 5138aa5

Please sign in to comment.