CDLUC3 / dmptool

DMPTool version of the DMPRoadmap codebase
https://dmptool.org
MIT License
58 stars 13 forks source link

Configure DMPTool with Matomo Tracking Code #490

Closed marisastrong closed 1 year ago

marisastrong commented 1 year ago

Brian has access to the Matomo tracking code. This needs to be configured in the DMPTool application.

Did DMPTool get configured with a GA4 tracker? If not, there currently is not any collection of analytics happening so sooner rather than later is best for configuration.

Here is the JavaScript Tracking code to include on all your pages. Make sure this code is embedded within a script element on every page of your website. It is recommend pasting it immediately before the closing head tag.

If you have questions you can pose them in the #matomo slack channel

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.cdlib.org/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '20']);
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);
})();
briri commented 1 year ago

Removed old GA script and replaced with Matomo script. The script is only applicable in production and requires the following configuration to be defined in config/dmproadmap.yaml, the Rails credentials file, AWS SSM parameters or a dotenv file depending on how you manage your existing config.

  # Matomo analytics tracking
  enable_matomo: true
  matomo_url: 'matomo.my.org'
  matomo_sit_id: 1
briri commented 1 year ago

This is done