Skip to content

Commit

Permalink
fix: only set walletLabel if defined
Browse files Browse the repository at this point in the history
  • Loading branch information
schmanu committed Oct 30, 2023
1 parent a81a348 commit ac4d76f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/services/analytics/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,3 @@ export enum DeviceType {
export enum AnalyticsUserProperties {
WALLET_LABEL = 'walletLabel',
}

export const WALLET_LABEL_NONE = 'NONE'
4 changes: 3 additions & 1 deletion src/services/analytics/useGtm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ac4d76f

Please sign in to comment.