From 6a79d45b8cb21add4ce5070f1f6e456727451fc9 Mon Sep 17 00:00:00 2001 From: spwoodcock Date: Wed, 29 May 2024 14:56:13 +0100 Subject: [PATCH] fix(frontend): correctly invoke matomo & sentry tracking in prod --- src/frontend/src/main.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/main.tsx b/src/frontend/src/main.tsx index 39af7b64e5..7d43cb76e6 100644 --- a/src/frontend/src/main.tsx +++ b/src/frontend/src/main.tsx @@ -50,7 +50,7 @@ axios.interceptors.request.use( (function sentryInit() { // Immediately invoked function to enable Sentry monitoring - if (import.meta.env.MODE === 'development' || import.meta.env.BASE_URL !== 'fmtm.hotosm.org') { + if (import.meta.env.MODE === 'development' || window.location.hostname !== 'fmtm.hotosm.org') { return; } console.log('Adding Sentry'); @@ -76,7 +76,7 @@ axios.interceptors.request.use( (function matomoTrackingInit() { // Immediately invoked function to enable Matomo tracking - if (import.meta.env.MODE === 'development' || import.meta.env.BASE_URL !== 'fmtm.hotosm.org') { + if (import.meta.env.MODE === 'development' || window.location.hostname !== 'fmtm.hotosm.org') { return; } console.log('Adding Matomo');