Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Matomo tracking #341

Open
2 tasks
egpbos opened this issue Sep 26, 2024 · 4 comments
Open
2 tasks

Add Matomo tracking #341

egpbos opened this issue Sep 26, 2024 · 4 comments

Comments

@egpbos
Copy link
Member

egpbos commented Sep 26, 2024

Following up on the discussion in #161, instead of Google Analytics, we should add Matomo tracking to the Guide. We also use Matomo for the corporate site and for the research software directory.

Veronica referred me to @ewan-escience who was able to give me an account on the RSD Matomo server. To enable Matomo tracking, we need to add a small piece of code in the rendered pages.

However, if we want to track, which uses cookies, we also need a cookie banner. So, two todo items in this issue:

  • Figure out how to get a cookie wall and implement it. We could perhaps take inspiration from the RSD.
  • Activate tracking, using the tracking code below (I'll update it if it becomes out of date, depending on fast someone will pick up this issue).
<!-- 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="//matomo.research.software/";
    _paq.push(['setTrackerUrl', u+'matomo.php']);
    _paq.push(['setSiteId', '5']);
    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 -->
@ewan-escience
Copy link
Member

Related to tracking, and in the light of #161, can the data-ga="UA-55088238-8" code and the plugin ga.min.js be removed?`

@egpbos
Copy link
Member Author

egpbos commented Oct 4, 2024

I will check whether they still work. I vaguely remember that we didn't update it recently after some old version API went offline. If they do, until we have Matomo, it may still be helpful to keep collecting there.

@egpbos
Copy link
Member Author

egpbos commented Oct 4, 2024

GA actually still is working, so let's keep it in for now while we move over to Matomo.

@ewan-escience
Copy link
Member

According to the documentation, you can also use Matomo without consent or cookie banner. This does impact the accuracy. We might also need a privacy policy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants