diff --git a/src/components/App.tsx b/src/components/App.tsx index d86299f0c29ce3228475fb39f2c26657fc442df2..d29f436c5a6c27593e90755ff4ff8a2fefd37726 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -25,8 +25,13 @@ export const App = ({ tracker }: AppProps) => { const { termsStatus } = useSelector((state: AppStore) => state.ecolyo.global) const isDev = new EnvironmentService().isDev() + console.log(isDev) + useEffect(() => { - if (tracker && !isDev) { + if ( + tracker + // && !isDev + ) { if (termsStatus.accepted) { tracker.connectToHistory() } diff --git a/src/utils/matomoTracker.ts b/src/utils/matomoTracker.ts index 2e43776d5a1a1f20373fc6f9f8b2bb19fabc9280..00a649b5716b7a8f1926b8c6aa33beb1f91b23ed 100644 --- a/src/utils/matomoTracker.ts +++ b/src/utils/matomoTracker.ts @@ -1,6 +1,5 @@ import { History, Location, UnregisterCallback } from 'history' import { readCozyDataFromDOM } from 'cozy-ui/transpiled/react/helpers/appDataset' -import hash from 'object-hash' interface InitSettings { cozyUrl: string @@ -53,7 +52,6 @@ export default class MatomoTracker { MatomoTracker.push(['setSiteId', this.siteId]) MatomoTracker.push(['setReferrerUrl', 'https://ecolyo.com']) MatomoTracker.push(['setTrackerUrl', `${this.url + this.phpFilename}`]) - MatomoTracker.push(['setUserId', hash(this.cozyUrl)]) MatomoTracker.push(['enableLinkTracking']) } return { @@ -82,10 +80,6 @@ export default class MatomoTracker { userId = userId.substring(0, indexOfPort) } } - - if (userId) { - MatomoTracker.push(['setUserId', userId]) - } } connectToHistory() { @@ -103,6 +97,7 @@ export default class MatomoTracker { } track(loc: Location) { + console.log(loc) if (typeof window === 'undefined') { return } @@ -110,7 +105,6 @@ export default class MatomoTracker { MatomoTracker.push(['setDocumentTitle', currentPath.substring(1)]) MatomoTracker.push(['setCustomUrl', 'https://ecolyo.com' + currentPath]) - MatomoTracker.push(['setUserId', hash(this.cozyUrl)]) MatomoTracker.push(['trackPageView']) } }