From 4de1c9e6026c875ada1a2420edfcf2314a09de38 Mon Sep 17 00:00:00 2001 From: Sharon Sheah <37326128+sharonsheah@users.noreply.github.com> Date: Thu, 21 Mar 2024 10:23:05 +1100 Subject: [PATCH] fix: analytics tracking for connect widget (#1609) --- .../widgets/connect/components/WalletList.tsx | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/checkout/widgets-lib/src/widgets/connect/components/WalletList.tsx b/packages/checkout/widgets-lib/src/widgets/connect/components/WalletList.tsx index ded4cc8308..43026275c3 100644 --- a/packages/checkout/widgets-lib/src/widgets/connect/components/WalletList.tsx +++ b/packages/checkout/widgets-lib/src/widgets/connect/components/WalletList.tsx @@ -127,18 +127,6 @@ export function WalletList(props: WalletListProps) { const isMetaMask = providerDetail.info.rdns === WalletProviderRdns.METAMASK; const web3Provider = new Web3Provider(providerDetail.provider as any); - track({ - userJourney: UserJourney.CONNECT, - screen: 'ConnectWallet', - control: 'Wallet', - controlType: 'MenuItem', - extras: { - wallet: getProviderSlugFromRdns(providerDetail.info.rdns), - walletRdns: providerDetail.info.rdns, - walletUuid: providerDetail.info.uuid, - }, - }); - try { // TODO: Find a nice way to detect if the wallet supports switching accounts via requestPermissions const changeAccount = isMetaMask; @@ -203,6 +191,12 @@ export function WalletList(props: WalletListProps) { }; const handleWalletConnectConnection = async () => { + track({ + userJourney: UserJourney.CONNECT, + screen: 'ConnectWallet', + control: 'WalletConnect', + controlType: 'MenuItem', + }); await openWalletConnectModal({ connectCallback, restoreSession: true, @@ -254,6 +248,12 @@ export function WalletList(props: WalletListProps) { }, [chosenProviderDetail]); const onBrowserWalletsClick = useCallback(() => { + track({ + userJourney: UserJourney.CONNECT, + screen: 'ConnectWallet', + control: 'BrowserWallets', + controlType: 'MenuItem', + }); setShowWalletDrawer(true); }, [track]);