From dc60b8180dab689da20cae1d7e9cf2022e5f8a5b Mon Sep 17 00:00:00 2001 From: Adamski Date: Thu, 29 Aug 2024 16:47:17 +0200 Subject: [PATCH] fix: Fingerprint and URL fallback; (#1276) --- src/hooks/userTracking/useUserTracking.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hooks/userTracking/useUserTracking.ts b/src/hooks/userTracking/useUserTracking.ts index 4d93c27d4..439901edc 100644 --- a/src/hooks/userTracking/useUserTracking.ts +++ b/src/hooks/userTracking/useUserTracking.ts @@ -121,10 +121,10 @@ export function useUserTracking() { data: data || {}, isConnected: account?.isConnected || false, walletAddress: account?.address || 'not_connected', - browserFingerprint: fp, + browserFingerprint: fp || 'unknown', isMobile: !isDesktop, sessionId: sessionId || 'unknown', - url: window?.location?.href, + url: window?.location?.href || process.env.NEXT_PUBLIC_SITE_URL, }; await jumperTrackEvent(eventData); } catch (error) { @@ -199,8 +199,8 @@ export function useUserTracking() { errorCode: data[TrackingEventParameter.ErrorCode], errorMessage: data[TrackingEventParameter.ErrorMessage], action: data[TrackingEventParameter.Action] || '', - url: window?.location?.href, - browserFingerprint: fp, + url: window?.location?.href || process.env.NEXT_PUBLIC_SITE_URL, + browserFingerprint: fp || 'unknown', }; await jumperTrackTransaction(transactionData); } @@ -214,7 +214,7 @@ export function useUserTracking() { }); } }, - [account?.address, jumperTrackTransaction, sessionId], + [account?.address, fp, jumperTrackTransaction, sessionId], ); return {