From 504f44102515fb9694b0dc745d0247a5501f6c94 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Mon, 20 Nov 2023 10:03:39 +0100 Subject: [PATCH] MOBILE-4459 analytics: Don't log analytic events for demo sites --- src/core/services/analytics.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/services/analytics.ts b/src/core/services/analytics.ts index 71146ad89..660e3958a 100644 --- a/src/core/services/analytics.ts +++ b/src/core/services/analytics.ts @@ -63,7 +63,7 @@ export class CoreAnalyticsService extends CoreDelegate { * @returns True if available, false otherwise. */ async isAnalyticsAvailable(): Promise { - if (Object.keys(this.enabledHandlers).length > 0) { + if (Object.keys(this.enabledHandlers).length > 0 && !CoreSites.getCurrentSite()?.isDemoModeSite()) { // There is an enabled handler, analytics is available. return true; } @@ -87,7 +87,7 @@ export class CoreAnalyticsService extends CoreDelegate { */ async logEvent(event: CoreAnalyticsAnyEvent): Promise { const site = CoreSites.getCurrentSite(); - if (!site) { + if (!site || site.isDemoModeSite()) { return; }