scholarsportal / dataverse-data-explorer-v2

Version 2 of the Dataverse Data Explorer.
13 stars 8 forks source link

Add Matomo tracking #28

Open nana-boateng opened 11 months ago

nana-boateng commented 11 months ago

From Sabina:

<!-- Matomo Tag Manager -->

<script>
  var _mtm = window._mtm = window._mtm || [];
  _mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'});
  (function() {
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.async=true; g.src='https://analytics.scholarsportal.info/js/container_MOTMjz1l_dev_860b195d069efc12f7a26700.js'; s.parentNode.insertBefore(g,s);
  })();
</script>

<!-- End Matomo Tag Manager -->
spagotto commented 10 months ago

Above is the code for the test environment. The code for the prod environment has a different container ID:

<!-- Matomo Tag Manager -->
<script>
  var _mtm = window._mtm = window._mtm || [];
  _mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'});
  (function() {
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.async=true; g.src='https://analytics.scholarsportal.info/js/container_JBxcbS7D.js'; s.parentNode.insertBefore(g,s);
  })();
</script>
<!-- End Matomo Tag Manager -->
spagotto commented 3 months ago

Just want to make sure this part doesn't get forgotten!