From ac19b21a5c21d8fe959b1cc8a3a2b4ea82d2c805 Mon Sep 17 00:00:00 2001 From: Manuel Sousa - BJSS <115169817+manuelsousa-bjss@users.noreply.github.com> Date: Mon, 24 Jun 2024 17:03:49 +0100 Subject: [PATCH] fix gtag (#1343) --- src/app/app.component.ts | 2 +- src/assets/js/analytics.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index afb6ffb72..78957cdb0 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -37,7 +37,7 @@ export class AppComponent { ) { this.router.events.pipe(filter((e): e is NavigationEnd => e instanceof NavigationEnd)).subscribe(e => { if (this.environmentStore.ENV.ENABLE_ANALYTICS) { - (typeof gtag === 'function') && + typeof gtag === 'function' && gtag('config', this.environmentStore.ENV.TAG_MEASUREMENT_ID, { page_path: e.urlAfterRedirects }); diff --git a/src/assets/js/analytics.js b/src/assets/js/analytics.js index f15862dc7..bb44ea0e5 100644 --- a/src/assets/js/analytics.js +++ b/src/assets/js/analytics.js @@ -1,7 +1,7 @@ const tagMeasurementId = window.__env.TAG_MEASUREMENT_ID; const gtmId = window.__env.GTM_ID; -const enableAnalytics = window.__env.ENABLE_ANALYTICS === "true"; +const enableAnalytics = window.__env.ENABLE_ANALYTICS === true; (function () {