This commit is contained in:
George Kalampokis 2020-12-14 17:34:27 +02:00
commit 4bbcb3d24e
1 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,7 @@ export class MatomoService {
trackPageView(customTitle?: string): void { trackPageView(customTitle?: string): void {
if (this.configurationService.matomoEnabled) { if (this.configurationService.matomoEnabled) {
var principal = this.authService.current(); var principal = this.authService.current();
this.matomoTracker.setUserId(principal ? principal.id : null); if (principal != null) { this.matomoTracker.setUserId(principal.id); }
this.matomoTracker.trackPageView(customTitle); this.matomoTracker.trackPageView(customTitle);
} }
} }
@ -32,7 +32,7 @@ export class MatomoService {
trackSiteSearch(keyword: string, category?: string, resultsCount?: number): void { trackSiteSearch(keyword: string, category?: string, resultsCount?: number): void {
if (this.configurationService.matomoEnabled) { if (this.configurationService.matomoEnabled) {
var principal = this.authService.current(); 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); this.matomoTracker.trackSiteSearch(keyword, category, resultsCount);
} }
} }