From eb153e84bcde3dadc650cd792b27d4b99698f9bd Mon Sep 17 00:00:00 2001 From: Diamantis Tziotzios Date: Mon, 14 Dec 2020 16:27:07 +0200 Subject: [PATCH] analytics fix --- dmp-frontend/src/app/core/services/matomo/matomo-service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dmp-frontend/src/app/core/services/matomo/matomo-service.ts b/dmp-frontend/src/app/core/services/matomo/matomo-service.ts index 7ad2660c9..f4711f996 100644 --- a/dmp-frontend/src/app/core/services/matomo/matomo-service.ts +++ b/dmp-frontend/src/app/core/services/matomo/matomo-service.ts @@ -24,7 +24,7 @@ export class MatomoService { trackPageView(customTitle?: string): void { if (this.configurationService.matomoEnabled) { var principal = this.authService.current(); - this.matomoTracker.setUserId(principal ? principal.id : null); + if (principal != null) { this.matomoTracker.setUserId(principal.id); } this.matomoTracker.trackPageView(customTitle); } } @@ -32,7 +32,7 @@ export class MatomoService { trackSiteSearch(keyword: string, category?: string, resultsCount?: number): void { if (this.configurationService.matomoEnabled) { var principal = this.authService.current(); - this.matomoTracker.setUserId(principal ? principal.id : null); + if (principal != null) { this.matomoTracker.setUserId(principal.id); } this.matomoTracker.trackSiteSearch(keyword, category, resultsCount); } }