Skip to content

Commit

Permalink
fix: add enum for user properties
Browse files Browse the repository at this point in the history
  • Loading branch information
schmanu committed Oct 24, 2023
1 parent 6fdc796 commit 108adb8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/services/analytics/useGtm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 108adb8

Please sign in to comment.