From 1471511c0396d5fd8c1fee4798189e2d2d63e4eb Mon Sep 17 00:00:00 2001 From: jessopb <36554050+jessopb@users.noreply.github.com> Date: Wed, 12 Aug 2020 11:04:38 -0400 Subject: [PATCH] Revert "check matomo and disable if necessary" This reverts commit f88b98ea62b6f632131d3421fd9eab86bcec1bf1. --- ui/analytics.js | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/ui/analytics.js b/ui/analytics.js index ededc2f08..a9bea13fd 100644 --- a/ui/analytics.js +++ b/ui/analytics.js @@ -56,24 +56,7 @@ type LogPublishParams = { channel_claim_id?: string, }; -const checkmatomo = (url, timeout = 2000) => { - return Promise.race([ - fetch(url), - new Promise((resolve, reject) => setTimeout(() => reject(new Error('timeout')), timeout)), - ]); -}; - let internalAnalyticsEnabled: boolean = IS_WEB || false; -let matomoOnline = true; -if (internalAnalyticsEnabled) { - checkmatomo(MATOMO_URL) - .then() - .catch(() => { - matomoOnline = false; - console.log('matomo offline'); - }); -} - // let thirdPartyAnalyticsEnabled: boolean = IS_WEB || false; // @if TARGET='app' if (window.localStorage.getItem(SHARE_INTERNAL) === 'true') internalAnalyticsEnabled = true; @@ -106,7 +89,7 @@ const analytics: Analytics = { }); }, pageView: path => { - if (internalAnalyticsEnabled && matomoOnline) { + if (internalAnalyticsEnabled) { MatomoInstance.trackPageView({ href: `${path}`, }); @@ -262,7 +245,7 @@ const analytics: Analytics = { }; function sendMatomoEvent(category, action, name, value) { - if (internalAnalyticsEnabled && matomoOnline) { + if (internalAnalyticsEnabled) { const event = { category, action, name, value }; MatomoInstance.trackEvent(event); } -- 2.45.3