diff --git a/src/bundles/analytics.js b/src/bundles/analytics.js index 1f13db2eb..eb1544636 100644 --- a/src/bundles/analytics.js +++ b/src/bundles/analytics.js @@ -453,9 +453,9 @@ const createAnalyticsBundle = ({ state = state || { lastEnabledAt: 0, lastDisabledAt: 0, - showAnalyticsComponents: DISABLE_ALL_ANALYTICS, // hide related UI for now, see https://github.com/ipfs/ipfs-webui/issues/2198 + showAnalyticsComponents: !DISABLE_ALL_ANALYTICS, // hide related UI for now, see https://github.com/ipfs/ipfs-webui/issues/2198 showAnalyticsBanner: false, - optedOut: !DISABLE_ALL_ANALYTICS, // disable analytics by default for now, see https://github.com/ipfs/ipfs-webui/issues/2198 + optedOut: DISABLE_ALL_ANALYTICS, // disable analytics by default for now, see https://github.com/ipfs/ipfs-webui/issues/2198 consent: [] } diff --git a/src/bundles/analytics.test.js b/src/bundles/analytics.test.js index a5e9a61c9..55319a12f 100644 --- a/src/bundles/analytics.test.js +++ b/src/bundles/analytics.test.js @@ -35,6 +35,16 @@ function createStore (analyticsOpts = {}, mockAnalyticsCachedState) { } describe('new/returning user default behavior', () => { + // 2024-Q2: disabling and hiding all metrics for now + // https://github.com/ipfs/ipfs-webui/pull/2216 + it('should disable analytics by default and hide all UI compontents', () => { + const store = createStore() + expect(store.selectShowAnalyticsComponents()).toBe(false) + expect(store.selectAnalyticsConsent()).toEqual([]) + expect(global.Countly.opt_in).not.toHaveBeenCalled() + expect(global.Countly.opt_out).not.toHaveBeenCalled() + }) + /* it('should enable analytics by default for new user who has not opted in or out', () => { const store = createStore() expect(global.Countly.opt_in).toHaveBeenCalled() @@ -42,6 +52,7 @@ describe('new/returning user default behavior', () => { // events will be sent as consents have been given by default expect(store.selectAnalyticsConsent()).toEqual(['sessions', 'events', 'views', 'location']) }) + */ it('should enable existing analytics by default for returning user who was opted_in', () => { const mockDefaultState = { lastEnabledAt: (new Date('2022-01-02')).getTime(),