Verified Commit 1ebbe51b authored by Laurent Heirendt's avatar Laurent Heirendt
Browse files

change mechanism of analytics

parent f01f5c0a
<!-- Matomo -->
<script type="text/javascript">
var _paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://analytics.lcsb.uni.lu/hub/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '4']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="https://analytics.lcsb.uni.lu/hub/matomo.php?idsite=4&amp;rec=1" style="border:0;" alt="" /></p></noscript>
<!-- End Matomo Code -->
\ No newline at end of file
......@@ -102,19 +102,21 @@ function getCookie(cname) {
/* loadMatomo: load the tracking code of the matomo instance */
function loadMatomo() {
var u = settings.matomoURL;
_paq.push(['setSiteId', settings.siteID]);
_paq.push(['setTrackerUrl', u + 'matomo.php']);
_paq.push(['setDoNotTrack', 1]);
_paq.push(['trackPageView']);
_paq.push(['setIgnoreClasses', ['no-tracking', 'colorbox']]);
_paq.push(['enableLinkTracking']);
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
g.type = 'text/javascript';
g.defer = true;
g.async = true;
g.src = u + 'matomo.js';
s.parentNode.insertBefore(g,s);
if (setting.siteID > 0) {
var u = settings.matomoURL;
_paq.push(['setSiteId', settings.siteID]);
_paq.push(['setTrackerUrl', u + 'matomo.php']);
_paq.push(['setDoNotTrack', 1]);
_paq.push(['trackPageView']);
_paq.push(['setIgnoreClasses', ['no-tracking', 'colorbox']]);
_paq.push(['enableLinkTracking']);
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
g.type = 'text/javascript';
g.defer = true;
g.async = true;
g.src = u + 'matomo.js';
s.parentNode.insertBefore(g,s);
}
}
/* showCookieBanner: show the banner */
......
......@@ -28,7 +28,4 @@
src='{{site.gitlab_host}}/assets/webpack/visual_review_toolbar.js'></script>
{%- endif -%}
{%- if jekyll.environment == 'production' and site.siteID > 0 -%}
{%- include analytics.html -%}
{%- endif -%}
</head>
......@@ -15,9 +15,6 @@
{%- include css-imports.html -%}
{%- if jekyll.environment == 'production' and site.siteID > 0 -%}
{%- include analytics.html -%}
{%- endif -%}
</head>
<body>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment