Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
}