From 5ce1463aba0fea054f71fc6f7bed043abbad3e76 Mon Sep 17 00:00:00 2001 From: Gery Hirschfeld Date: Thu, 22 Aug 2024 14:30:26 +0200 Subject: [PATCH] feat(): ga can be disabled with local storage key ga_debug_mode --- src/google-tag-manager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google-tag-manager.ts b/src/google-tag-manager.ts index 2d79e2e..d839eb3 100644 --- a/src/google-tag-manager.ts +++ b/src/google-tag-manager.ts @@ -12,7 +12,7 @@ export class BalGoogleTagManager { public isEnabled(): boolean { const win = window - return win && ((win as any)[DATA_LAYER] != null || win.localStorage.getItem('ga_debug_mode') === 'true'); + return win && (win as any)[DATA_LAYER] != null && win.localStorage.getItem('ga_debug_mode') !== 'true'; } public load(settings: GtmSettings): void {