How to use the cozy-ui/transpiled/react/helpers/tracker.getTracker function in cozy-ui

To help you get started, we’ve selected a few cozy-ui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cozy / cozy.github.io / en / cozy-banks / src / utils / history.js View on Github external
export const setupHistory = () => {
  const piwikEnabled = shouldEnableTracking() && getTracker()
  let history = hashHistory
  if (piwikEnabled) {
    const trackerInstance = getTracker()
    history = trackerInstance.connectToHistory(history)
    trackerInstance.track(history.getCurrentLocation()) // when using a hash history, the initial visit is not tracked by piwik react router
  }
  return history
}