From ac4d76ff5e55dd80126f3a190260105f9337afb0 Mon Sep 17 00:00:00 2001 From: schmanu Date: Mon, 30 Oct 2023 09:16:42 +0100 Subject: [PATCH] fix: only set walletLabel if defined --- src/services/analytics/types.ts | 2 -- src/services/analytics/useGtm.ts | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services/analytics/types.ts b/src/services/analytics/types.ts index b22f27b847..47fb97dbb6 100644 --- a/src/services/analytics/types.ts +++ b/src/services/analytics/types.ts @@ -33,5 +33,3 @@ export enum DeviceType { export enum AnalyticsUserProperties { WALLET_LABEL = 'walletLabel', } - -export const WALLET_LABEL_NONE = 'NONE' diff --git a/src/services/analytics/useGtm.ts b/src/services/analytics/useGtm.ts index 8870bbea15..8314ed0229 100644 --- a/src/services/analytics/useGtm.ts +++ b/src/services/analytics/useGtm.ts @@ -83,7 +83,9 @@ const useGtm = () => { }, [router.pathname]) useEffect(() => { - gtmSetUserProperty(AnalyticsUserProperties.WALLET_LABEL, walletLabel ?? WALLET_LABEL_NONE) + if (walletLabel) { + gtmSetUserProperty(AnalyticsUserProperties.WALLET_LABEL, walletLabel) + } }, [walletLabel]) // Track meta events on app load