From 108adb86ff05ce5b7da7ee8d35f80fe7dea219bd Mon Sep 17 00:00:00 2001 From: schmanu Date: Tue, 24 Oct 2023 18:20:31 +0200 Subject: [PATCH] fix: add enum for user properties --- src/services/analytics/useGtm.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/services/analytics/useGtm.ts b/src/services/analytics/useGtm.ts index ee64e7d854..0be888fff7 100644 --- a/src/services/analytics/useGtm.ts +++ b/src/services/analytics/useGtm.ts @@ -26,6 +26,12 @@ import { DeviceType } from './types' import useSafeAddress from '@/hooks/useSafeAddress' import useWallet from '@/hooks/wallets/useWallet' +enum GA_USER_PROPERTIES { + WALLET_LABEL = 'walletLabel', +} + +const WALLET_LABEL_NONE = 'NONE' + const useGtm = () => { const chainId = useChainId() const cookies = useAppSelector(selectCookies) @@ -83,7 +89,7 @@ const useGtm = () => { }, [router.pathname]) useEffect(() => { - gtmSetUserProperty('walletLabel', walletLabel ?? 'NONE') + gtmSetUserProperty(GA_USER_PROPERTIES.WALLET_LABEL, walletLabel ?? WALLET_LABEL_NONE) }, [walletLabel]) // Track meta events on app load