eea / volto-matomo

Matomo integration for Volto
MIT License
3 stars 1 forks source link

Support other matomo config params #20

Closed giuliaghisini closed 1 year ago

giuliaghisini commented 2 years ago

in particular:

Suggestion: add it in src/utils.js like:

.... **const trackerUrl = window.env?.RAZZLE_MATOMO_TRACKER_URL || config.settings.matomoTrackerUrl || undefined;

  const srcUrl =
    window.env?.RAZZLE_MATOMO_SRC_URL ||
    config.settings.matomoSrcUrl ||
    undefined;**

  if (siteId) {
    _matomo.instance = createInstance({
      urlBase,
      siteId,
      **trackerUrl,
      srcUrl,**
    });
  } else {
    /* eslint-disable-next-line */
    console.warn(
      'Matomo SiteID is not defined, page actions will not be tracked',
    );
  }

....