From 76b1289bb6eed472890e757763f43d616969f683 Mon Sep 17 00:00:00 2001 From: Usame Algan Date: Mon, 13 Jun 2022 15:16:06 +0200 Subject: [PATCH 1/4] fix: Track more safe creation steps --- .../components/SafeCreationProcess.tsx | 3 +++ src/routes/opening/index.tsx | 3 +++ src/utils/events/createLoadSafe.ts | 16 ++++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/src/routes/CreateSafePage/components/SafeCreationProcess.tsx b/src/routes/CreateSafePage/components/SafeCreationProcess.tsx index 24b79cf7a3..f18544b500 100644 --- a/src/routes/CreateSafePage/components/SafeCreationProcess.tsx +++ b/src/routes/CreateSafePage/components/SafeCreationProcess.tsx @@ -131,6 +131,7 @@ const createNewSafe = (userAddress: string, onHash: (hash: string) => void): Pro deploymentTx .send(sendParams) .once('transactionHash', (txHash) => { + trackEvent(CREATE_SAFE_EVENTS.SUBMIT_CREATE_SAFE) onHash(txHash) saveToStorage(SAFE_PENDING_CREATION_STORAGE_KEY, { @@ -255,6 +256,7 @@ function SafeCreationProcess(): ReactElement { } const onRetry = (): void => { + trackEvent(CREATE_SAFE_EVENTS.RETRY_CREATE_SAFE) const safeCreationFormValues = loadSavedDataOrLeave() if (!safeCreationFormValues) { @@ -272,6 +274,7 @@ function SafeCreationProcess(): ReactElement { } const onCancel = () => { + trackEvent(CREATE_SAFE_EVENTS.CANCEL_CREATE_SAFE) removeFromStorage(SAFE_PENDING_CREATION_STORAGE_KEY) goToWelcomePage() } diff --git a/src/routes/opening/index.tsx b/src/routes/opening/index.tsx index 14d019c6d1..2d1e777dff 100644 --- a/src/routes/opening/index.tsx +++ b/src/routes/opening/index.tsx @@ -25,6 +25,8 @@ import { showNotification } from 'src/logic/notifications/store/notifications' import { getNewSafeAddressFromLogs } from 'src/routes/opening/utils/getSafeAddressFromLogs' import { getExplorerInfo } from 'src/config' import PrefixedEthHashInfo from 'src/components/PrefixedEthHashInfo' +import { trackEvent } from 'src/utils/googleTagManager' +import { CREATE_SAFE_EVENTS } from 'src/utils/events/createLoadSafe' export const SafeDeployment = ({ creationTxHash, @@ -119,6 +121,7 @@ export const SafeDeployment = ({ setStepIndex(1) setIntervalStarted(true) } catch (err) { + trackEvent(CREATE_SAFE_EVENTS.REJECT_CREATE_SAFE) onError(err) } } diff --git a/src/utils/events/createLoadSafe.ts b/src/utils/events/createLoadSafe.ts index 914287481b..7b31dc2413 100644 --- a/src/utils/events/createLoadSafe.ts +++ b/src/utils/events/createLoadSafe.ts @@ -20,6 +20,22 @@ const CREATE_SAFE = { event: GTM_EVENT.META, action: 'Threshold', }, + SUBMIT_CREATE_SAFE: { + event: GTM_EVENT.META, + action: 'Submit Create Safe', + }, + REJECT_CREATE_SAFE: { + event: GTM_EVENT.META, + action: 'Reject Create Safe', + }, + RETRY_CREATE_SAFE: { + event: GTM_EVENT.META, + action: 'Retry Create Safe', + }, + CANCEL_CREATE_SAFE: { + event: GTM_EVENT.META, + action: 'Cancel Create Safe', + }, CREATED_SAFE: { event: GTM_EVENT.META, action: 'Created Safe', From 99801bb3b0b75193397a2ecc41c7ac9e9f0e7525 Mon Sep 17 00:00:00 2001 From: Usame Algan <5880855+usame-algan@users.noreply.github.com> Date: Mon, 13 Jun 2022 16:28:50 +0200 Subject: [PATCH 2/4] Update src/utils/events/createLoadSafe.ts Co-authored-by: Aaron Cook --- src/utils/events/createLoadSafe.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/events/createLoadSafe.ts b/src/utils/events/createLoadSafe.ts index 7b31dc2413..86ea501de0 100644 --- a/src/utils/events/createLoadSafe.ts +++ b/src/utils/events/createLoadSafe.ts @@ -22,19 +22,19 @@ const CREATE_SAFE = { }, SUBMIT_CREATE_SAFE: { event: GTM_EVENT.META, - action: 'Submit Create Safe', + action: 'Submit Safe creation', }, REJECT_CREATE_SAFE: { event: GTM_EVENT.META, - action: 'Reject Create Safe', + action: 'Reject Safe creation', }, RETRY_CREATE_SAFE: { event: GTM_EVENT.META, - action: 'Retry Create Safe', + action: 'Retry Safe creation', }, CANCEL_CREATE_SAFE: { event: GTM_EVENT.META, - action: 'Cancel Create Safe', + action: 'Cancel Safe creation', }, CREATED_SAFE: { event: GTM_EVENT.META, From e080b01889bb9124ab3210e43b08a567291b19d4 Mon Sep 17 00:00:00 2001 From: Usame Algan Date: Tue, 14 Jun 2022 09:37:30 +0200 Subject: [PATCH 3/4] fix: Check for wallet rejection before tracking --- src/routes/opening/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/routes/opening/index.tsx b/src/routes/opening/index.tsx index 2d1e777dff..7de5b00df6 100644 --- a/src/routes/opening/index.tsx +++ b/src/routes/opening/index.tsx @@ -27,6 +27,7 @@ import { getExplorerInfo } from 'src/config' import PrefixedEthHashInfo from 'src/components/PrefixedEthHashInfo' import { trackEvent } from 'src/utils/googleTagManager' import { CREATE_SAFE_EVENTS } from 'src/utils/events/createLoadSafe' +import { isWalletRejection } from 'src/logic/wallets/errors' export const SafeDeployment = ({ creationTxHash, @@ -121,7 +122,9 @@ export const SafeDeployment = ({ setStepIndex(1) setIntervalStarted(true) } catch (err) { - trackEvent(CREATE_SAFE_EVENTS.REJECT_CREATE_SAFE) + if (isWalletRejection(err)) { + trackEvent(CREATE_SAFE_EVENTS.REJECT_CREATE_SAFE) + } onError(err) } } From d1a88d8835ab5a27cb67fcc45992f3ee92c07555 Mon Sep 17 00:00:00 2001 From: Usame Algan Date: Wed, 15 Jun 2022 12:14:32 +0200 Subject: [PATCH 4/4] fix: Remove back button after safe creation submission --- src/routes/opening/index.tsx | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/routes/opening/index.tsx b/src/routes/opening/index.tsx index 7de5b00df6..7213faa441 100644 --- a/src/routes/opening/index.tsx +++ b/src/routes/opening/index.tsx @@ -6,7 +6,6 @@ import styled from 'styled-components' import { ErrorFooter } from 'src/routes/opening/components/Footer' import { isConfirmationStep, steps } from './steps' -import Button from 'src/components/layout/Button' import Heading from 'src/components/layout/Heading' import Img from 'src/components/layout/Img' import Paragraph from 'src/components/layout/Paragraph' @@ -315,12 +314,6 @@ export const SafeDeployment = ({ ) : null} - - {stepIndex !== 0 && ( - - Back - - )} ) } @@ -424,8 +417,3 @@ const BodyFooter = styled.div` justify-content: center; align-items: flex-end; ` - -const BackButton = styled(Button)` - grid-column: 2; - margin: 20px auto 0; -`