From 760d1157078aad99d802192edb99b79002f92028 Mon Sep 17 00:00:00 2001 From: spwoodcock Date: Wed, 29 May 2024 15:55:25 +0100 Subject: [PATCH] build: add matomo code directly to index.html --- src/frontend/index.html | 29 +++++++++++++++++++++++++++++ src/frontend/src/main.tsx | 27 --------------------------- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/frontend/index.html b/src/frontend/index.html index 22be2ec75e..01bf117cd7 100755 --- a/src/frontend/index.html +++ b/src/frontend/index.html @@ -16,6 +16,35 @@ + + + + diff --git a/src/frontend/src/main.tsx b/src/frontend/src/main.tsx index 7d43cb76e6..10b64b5aef 100644 --- a/src/frontend/src/main.tsx +++ b/src/frontend/src/main.tsx @@ -74,33 +74,6 @@ axios.interceptors.request.use( }); })(); -(function matomoTrackingInit() { - // Immediately invoked function to enable Matomo tracking - if (import.meta.env.MODE === 'development' || window.location.hostname !== 'fmtm.hotosm.org') { - return; - } - console.log('Adding Matomo'); - - var _paq = (window._paq = window._paq || []); - /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ - _paq.push(['requireConsent']); - _paq.push(['setDomains', ['fmtm.hotosm.org']]); - _paq.push(['trackPageView']); - _paq.push(['enableLinkTracking']); // Tracks downloads - _paq.push(['trackVisibleContentImpressions']); // Tracks content blocks - (function () { - var u = '//matomo.hotosm.org/'; - _paq.push(['setTrackerUrl', u + 'matomo.php']); - _paq.push(['setSiteId', environment.matomoTrackingId]); - 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); - })(); -})(); - // React 17 setup ReactDOM.render(, document.getElementById('app'));