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

@datapunt/matomo-tracker-js is unmaintained #39

Open
davisagli opened this issue Dec 19, 2024 · 0 comments
Open

@datapunt/matomo-tracker-js is unmaintained #39

davisagli opened this issue Dec 19, 2024 · 0 comments

Comments

@davisagli
Copy link
Member

This package currently uses @datapunt/matomo-tracker-js to send pageview events to Matomo, but it is unmaintained and frankly overkill for this use case. The basic Matomo tracking code is pretty simple and we can re-create it in React without using a library:

<!-- 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="//some.domain.com/";
    _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=u+'matomo.js'; s.parentNode.insertBefore(g,s);
  })();
</script>
<!-- End Matomo Code -->
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

1 participant