carpentries / sandpaper

User Interface for The Carpentries Workbench
https://carpentries.github.io/sandpaper
Other
41 stars 26 forks source link

Add support for configurable analytics #586

Closed froggleston closed 1 month ago

froggleston commented 1 month ago

This PR aims to implement configurable analytics to address #438 with a new config.yaml option, analytics.

Options:

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>
froggleston commented 1 month ago

Thanks @tobyhodges ! I agree. The addition of user-specified tracking code would hopefully be fairly transparent, as tracking code would be committed alongside any lesson. I think that at least having the option to include or exclude Matomo tracking would make this PR worth it.