Skip to content

Commit

Permalink
enable matomo tracking code
Browse files Browse the repository at this point in the history
  • Loading branch information
zzacharo committed Mar 16, 2023
1 parent 4056101 commit 8be5760
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions demo-invenioils/invenio.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ I18N_LANGUAGES = [
# ('fr', _('French'))
]

# Invenio-Theme
# =============
# See https://invenio-theme.readthedocs.io/en/latest/configuration.html

# Site tracking code template for matomo analytics
# Enable the below on the dedicated environment
# THEME_TRACKINGCODE_TEMPLATE = "demo_invenioils/trackingcode-prod.html"

###############################################################################
# Database
###############################################################################
Expand Down
15 changes: 15 additions & 0 deletions demo-invenioils/templates/demo_invenioils/trackingcode-prod.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Matomo for https://invenioils.web.cern.ch/ -->
<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://webanalytics.web.cern.ch/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '235']);
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 -->

0 comments on commit 8be5760

Please sign in to comment.