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

Make inclusion of Matomo optional #37

Closed
fiveop opened this issue May 13, 2022 · 4 comments · Fixed by #138
Closed

Make inclusion of Matomo optional #37

fiveop opened this issue May 13, 2022 · 4 comments · Fixed by #138
Labels
enhancement New feature or request

Comments

@fiveop
Copy link

fiveop commented May 13, 2022

Currently, Matomo is always included when someone uses varnish. If the workbench is supposed to be used like the old template, in particular for lesson material listed on the community lessons, there will be other legal entities than the Carpentries that are responsible for hosting pages generated by the workbench suite. As it stands they have no option, but to include the Matomo tracking/analytics script. At least in the EU, to be diligent, they should check what kind of data this collects and I am not sure whether that is possible for anyone but the Carpentries.

@zkamvar
Copy link
Contributor

zkamvar commented May 13, 2022

For clarity, the matomo code you refer to exists here:

<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
_paq.push(["setDomains", ["*.lessons.carpentries.org","*.datacarpentry.github.io","*.datacarpentry.org","*.librarycarpentry.github.io","*.librarycarpentry.org","*.swcarpentry.github.io", "*.carpentries.github.io"]]);
_paq.push(["setDoNotTrack", true]);
_paq.push(["disableCookies"]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://carpentries.matomo.cloud/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src='https://cdn.matomo.cloud/carpentries.matomo.cloud/matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->

@fmichonneau contributed this and can speak to how it works, but from what I understand it will only collect if a site is hosted on one of our official sites. The move to matomo was a strategic move to ensure that our lessons aligned with our privacy policy, which conforms to GDPR and CCPA. For what it's worth, this is not different to how the styles template is implemented.

Would it help if I included an optional yaml item in config.yaml called analytics that allows you to specify a custom analytics script (or nothing) if desired?

something like this to set the analytics to nothing:

analytics: '<!-- no analytics -->'

or like this to use your own analytics code.

analytics: |
  <!-- Global site tag (gtag.js) - Google Analytics -->
  <script async src="https://www.googletagmanager.com/gtag/js?id={YOUR TRACKING ID}"#' ></script>
  <script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', '{YOUR TRACKING ID}');
  </script>

@zkamvar zkamvar added the enhancement New feature or request label May 13, 2022
@fiveop
Copy link
Author

fiveop commented May 13, 2022

I found the code and it looked like it would only work on certain domains (as you now confirm). However, I think it would save users not belonging to the Carpentries some trouble, if they would not even have to think about it. So an option like you suggest would be really helpful. To prevent repetition in Carpentries hosted lessons you could have three options: none, carpentries, <custom>

@zkamvar
Copy link
Contributor

zkamvar commented Apr 11, 2023

I found the code and it looked like it would only work on certain domains (as you now confirm). However, I think it would save users not belonging to the Carpentries some trouble, if they would not even have to think about it. So an option like you suggest would be really helpful. To prevent repetition in Carpentries hosted lessons you could have three options: none, carpentries, <custom>

Hi @fiveop, sorry to take so long to address this. A while ago, I excluded the matomo code completely for the lesson and so there is no tracking at all. I think your solution fits well and I will implement it in May.

@zkamvar
Copy link
Contributor

zkamvar commented May 28, 2024

Just got the notification this was closed. Well done, @froggleston! It turns out that I didn't specify which May it would get implemented in 😅

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

Successfully merging a pull request may close this issue.

2 participants