From ddcbab44f4a71643f3a0ed5bf60b378bc47b75d4 Mon Sep 17 00:00:00 2001 From: Antonio Regadas Date: Tue, 6 Jun 2023 12:31:49 +0100 Subject: [PATCH 1/6] adds metametrics enums --- shared/constants/metametrics.ts | 10 +++++++++ .../signature-request.component.js | 6 +++--- .../app/wallet-overview/eth-overview.js | 8 +++---- .../interactive-replacement-token-modal.js | 5 +++-- .../confirm-add-custodian-token.js | 13 ++++++------ .../confirm-add-institutional-feature.js | 5 +++-- ui/pages/institutional/custody/custody.js | 21 ++++++++++--------- 7 files changed, 41 insertions(+), 27 deletions(-) diff --git a/shared/constants/metametrics.ts b/shared/constants/metametrics.ts index 453ba97ea0c7..acb73d5b265a 100644 --- a/shared/constants/metametrics.ts +++ b/shared/constants/metametrics.ts @@ -586,7 +586,17 @@ export enum MetaMetricsEventName { UserClickedDeepLink = 'User Clicked Deeplink', UserClickedConnectCustodialAccount = 'Clicked Connect Custodial Account', UserClickedPortfolioButton = 'Clicked Portfolio Button', + UserClickedStakeButton = 'Clicked Stake Button', UserClickedCompliance = 'Clicked Compliance', + UserClickedRefreshTokenLink = 'User clicked refresh token link', + ShowDeeplinkForSignature = 'Show deeplink for signature', + CustodianOnboarding = 'Custodian onboarding', + InstitutionalFeatureConnection = 'Institutional feature connection', + CustodianSelected = 'Custodian selected', + ConnectCustodian = 'Connect to custodian', + ConnectCustodianCancel = 'Connect to custodian cancel', + ConnectCustodianError = 'Connect to custodian error', + CustodialAccountsConnected = 'Custodial accounts connected', ///: END:ONLY_INCLUDE_IN AccountDetailMenuOpened = 'Account Details Menu Opened', BlockExplorerLinkClicked = 'Block Explorer Clicked', diff --git a/ui/components/app/signature-request/signature-request.component.js b/ui/components/app/signature-request/signature-request.component.js index a1698d55373d..41f86e38f9e9 100644 --- a/ui/components/app/signature-request/signature-request.component.js +++ b/ui/components/app/signature-request/signature-request.component.js @@ -10,7 +10,7 @@ import { shortenAddress, ///: END:ONLY_INCLUDE_IN } from '../../../helpers/utils/util'; -import { MetaMetricsEventCategory } from '../../../../shared/constants/metametrics'; +import { MetaMetricsEventCategory, MetaMetricsEventName } from '../../../../shared/constants/metametrics'; import SiteOrigin from '../../ui/site-origin'; import Button from '../../ui/button'; import Typography from '../../ui/typography/typography'; @@ -122,8 +122,8 @@ export default class SignatureRequest extends PureComponent { onDeepLinkFetched: () => undefined, onDeepLinkShown: () => { this.context.trackEvent({ - category: 'MMI', - event: 'Show deeplink for signature', + category: MetaMetricsEventCategory.MMI, + event: MetaMetricsEventName.ShowDeeplinkForSignature }); }, }); diff --git a/ui/components/app/wallet-overview/eth-overview.js b/ui/components/app/wallet-overview/eth-overview.js index 7ae199e5b839..662a2a8e0e08 100644 --- a/ui/components/app/wallet-overview/eth-overview.js +++ b/ui/components/app/wallet-overview/eth-overview.js @@ -79,15 +79,15 @@ const EthOverview = ({ className }) => { const portfolioEvent = () => { trackEvent({ - category: 'Navigation', - event: 'Clicked Portfolio Button', + category: MetaMetricsEventCategory.Navigation, + event: MetaMetricsEventName.UserClickedPortfolioButton, }); }; const stakingEvent = () => { trackEvent({ - category: 'Navigation', - event: 'Clicked Stake Button', + category: MetaMetricsEventCategory.Navigation, + event: MetaMetricsEventName.UserClickedPortfolioButton, }); }; diff --git a/ui/components/institutional/interactive-replacement-token-modal/interactive-replacement-token-modal.js b/ui/components/institutional/interactive-replacement-token-modal/interactive-replacement-token-modal.js index d5cb845472a8..511677c35dd8 100644 --- a/ui/components/institutional/interactive-replacement-token-modal/interactive-replacement-token-modal.js +++ b/ui/components/institutional/interactive-replacement-token-modal/interactive-replacement-token-modal.js @@ -19,6 +19,7 @@ import { TextAlign, AlignItems, } from '../../../helpers/constants/design-system'; +import { MetaMetricsEventCategory, MetaMetricsEventName } from '../../../../shared/constants/metametrics'; const InteractiveReplacementTokenModal = () => { const t = useI18nContext(); @@ -119,8 +120,8 @@ const InteractiveReplacementTokenModal = () => { }); trackEvent({ - category: 'MMI', - event: 'User clicked refresh token link', + category: MetaMetricsEventCategory.MMI, + event: MetaMetricsEventName.UserClickedRefreshTokenLink, }); }; diff --git a/ui/pages/institutional/confirm-add-custodian-token/confirm-add-custodian-token.js b/ui/pages/institutional/confirm-add-custodian-token/confirm-add-custodian-token.js index 15c879463dcd..d5608a2e8e21 100644 --- a/ui/pages/institutional/confirm-add-custodian-token/confirm-add-custodian-token.js +++ b/ui/pages/institutional/confirm-add-custodian-token/confirm-add-custodian-token.js @@ -25,6 +25,7 @@ import { BUTTON_VARIANT, } from '../../../components/component-library'; import Box from '../../../components/ui/box'; +import { MetaMetricsEventCategory, MetaMetricsEventName } from '../../../../shared/constants/metametrics'; const ConfirmAddCustodianToken = () => { const t = useContext(I18nContext); @@ -95,8 +96,8 @@ const ConfirmAddCustodianToken = () => { } trackEvent({ - category: 'MMI', - event: 'Custodian onboarding', + category: MetaMetricsEventCategory.MMI, + event: MetaMetricsEventName.CustodianOnboarding, properties: { actions: 'Custodian RPC request', custodian: connectRequest.custodian, @@ -194,8 +195,8 @@ const ConfirmAddCustodianToken = () => { }); history.push(mostRecentOverviewPage); trackEvent({ - category: 'MMI', - event: 'Custodian onboarding', + category: MetaMetricsEventCategory.MMI, + event: MetaMetricsEventName.CustodianOnboarding, properties: { actions: 'Custodian RPC cancel', custodian: connectRequest.custodian, @@ -242,8 +243,8 @@ const ConfirmAddCustodianToken = () => { token: connectRequest.token, }); trackEvent({ - category: 'MMI', - event: 'Custodian onboarding', + category: MetaMetricsEventCategory.MMI, + event: MetaMetricsEventName.CustodianOnboarding, properties: { actions: 'Custodian RPC confirm', custodian: connectRequest.custodian, diff --git a/ui/pages/institutional/confirm-add-institutional-feature/confirm-add-institutional-feature.js b/ui/pages/institutional/confirm-add-institutional-feature/confirm-add-institutional-feature.js index fa7f60b7c0ef..c07945e7c01e 100644 --- a/ui/pages/institutional/confirm-add-institutional-feature/confirm-add-institutional-feature.js +++ b/ui/pages/institutional/confirm-add-institutional-feature/confirm-add-institutional-feature.js @@ -21,6 +21,7 @@ import { } from '../../../helpers/constants/design-system'; import Box from '../../../components/ui/box'; import { mmiActionsFactory } from '../../../store/institutional/institution-background'; +import { MetaMetricsEventCategory, MetaMetricsEventName } from '../../../../shared/constants/metametrics'; export default function ConfirmAddInstitutionalFeature({ history }) { const t = useI18nContext(); @@ -52,8 +53,8 @@ export default function ConfirmAddInstitutionalFeature({ history }) { const sendEvent = ({ actions, service }) => { trackEvent({ - category: 'MMI', - event: 'Institutional feature connection', + category: MetaMetricsEventCategory.MMI, + event: MetaMetricsEventName.InstitutionalFeatureConnection, properties: { actions, service, diff --git a/ui/pages/institutional/custody/custody.js b/ui/pages/institutional/custody/custody.js index 828eb3020636..76a44218858e 100644 --- a/ui/pages/institutional/custody/custody.js +++ b/ui/pages/institutional/custody/custody.js @@ -44,6 +44,7 @@ import { getCurrentChainId } from '../../../selectors'; import { getMMIConfiguration } from '../../../selectors/institutional/selectors'; import CustodyAccountList from '../connect-custody/account-list'; import JwtUrlForm from '../../../components/institutional/jwt-url-form'; +import { MetaMetricsEventCategory, MetaMetricsEventName } from '../../../../shared/constants/metametrics'; const CustodyPage = () => { const t = useI18nContext(); @@ -124,8 +125,8 @@ const CustodyPage = () => { setCurrentJwt(jwtListValue[0] || ''); setJwtList(jwtListValue); trackEvent({ - category: 'MMI', - event: 'Custodian Selected', + category: MetaMetricsEventCategory.MMI, + event: MetaMetricsEventName.CustodianSelected, properties: { custodian: custodian.name, }, @@ -167,8 +168,8 @@ const CustodyPage = () => { `Something went wrong connecting your custodian account. Error details: ${errorMessage}`, ); trackEvent({ - category: 'MMI', - event: 'Connect to custodian error', + category: MetaMetricsEventCategory.MMI, + event: MetaMetricsEventName.ConnectCustodianError, properties: { custodian: selectedCustodianName, }, @@ -204,8 +205,8 @@ const CustodyPage = () => { ); setAccounts(accountsValue); trackEvent({ - category: 'MMI', - event: 'Connect to custodian', + category: MetaMetricsEventCategory.MMI, + event: MetaMetricsEventName.ConnectCustodian, properties: { custodian: selectedCustodianName, apiUrl, @@ -514,8 +515,8 @@ const CustodyPage = () => { }, }); trackEvent({ - category: 'MMI', - event: 'Custodial accounts connected', + category: MetaMetricsEventCategory.MMI, + event: MetaMetricsEventName.CustodialAccountsConnected, properties: { custodian: selectedCustodianName, numberOfAccounts: Object.keys(selectedAccounts).length, @@ -540,8 +541,8 @@ const CustodyPage = () => { } trackEvent({ - category: 'MMI', - event: 'Connect to custodian cancel', + category: MetaMetricsEventCategory.MMI, + event: MetaMetricsEventName.ConnectCustodianCancel, properties: { custodian: selectedCustodianName, numberOfAccounts: Object.keys(selectedAccounts).length, From d5d0a3de224f00e60cc8cfab8a376a68ba275695 Mon Sep 17 00:00:00 2001 From: Antonio Regadas Date: Tue, 6 Jun 2023 15:26:01 +0100 Subject: [PATCH 2/6] prettier --- .../app/signature-request/signature-request.component.js | 7 +++++-- .../interactive-replacement-token-modal.js | 5 ++++- .../confirm-add-custodian-token.js | 5 ++++- .../confirm-add-institutional-feature.js | 5 ++++- ui/pages/institutional/custody/custody.js | 5 ++++- 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/ui/components/app/signature-request/signature-request.component.js b/ui/components/app/signature-request/signature-request.component.js index 41f86e38f9e9..5cd645dc7973 100644 --- a/ui/components/app/signature-request/signature-request.component.js +++ b/ui/components/app/signature-request/signature-request.component.js @@ -10,7 +10,10 @@ import { shortenAddress, ///: END:ONLY_INCLUDE_IN } from '../../../helpers/utils/util'; -import { MetaMetricsEventCategory, MetaMetricsEventName } from '../../../../shared/constants/metametrics'; +import { + MetaMetricsEventCategory, + MetaMetricsEventName, +} from '../../../../shared/constants/metametrics'; import SiteOrigin from '../../ui/site-origin'; import Button from '../../ui/button'; import Typography from '../../ui/typography/typography'; @@ -123,7 +126,7 @@ export default class SignatureRequest extends PureComponent { onDeepLinkShown: () => { this.context.trackEvent({ category: MetaMetricsEventCategory.MMI, - event: MetaMetricsEventName.ShowDeeplinkForSignature + event: MetaMetricsEventName.ShowDeeplinkForSignature, }); }, }); diff --git a/ui/components/institutional/interactive-replacement-token-modal/interactive-replacement-token-modal.js b/ui/components/institutional/interactive-replacement-token-modal/interactive-replacement-token-modal.js index 511677c35dd8..9ceea07a8b5c 100644 --- a/ui/components/institutional/interactive-replacement-token-modal/interactive-replacement-token-modal.js +++ b/ui/components/institutional/interactive-replacement-token-modal/interactive-replacement-token-modal.js @@ -19,7 +19,10 @@ import { TextAlign, AlignItems, } from '../../../helpers/constants/design-system'; -import { MetaMetricsEventCategory, MetaMetricsEventName } from '../../../../shared/constants/metametrics'; +import { + MetaMetricsEventCategory, + MetaMetricsEventName, +} from '../../../../shared/constants/metametrics'; const InteractiveReplacementTokenModal = () => { const t = useI18nContext(); diff --git a/ui/pages/institutional/confirm-add-custodian-token/confirm-add-custodian-token.js b/ui/pages/institutional/confirm-add-custodian-token/confirm-add-custodian-token.js index d5608a2e8e21..935a8625841d 100644 --- a/ui/pages/institutional/confirm-add-custodian-token/confirm-add-custodian-token.js +++ b/ui/pages/institutional/confirm-add-custodian-token/confirm-add-custodian-token.js @@ -25,7 +25,10 @@ import { BUTTON_VARIANT, } from '../../../components/component-library'; import Box from '../../../components/ui/box'; -import { MetaMetricsEventCategory, MetaMetricsEventName } from '../../../../shared/constants/metametrics'; +import { + MetaMetricsEventCategory, + MetaMetricsEventName, +} from '../../../../shared/constants/metametrics'; const ConfirmAddCustodianToken = () => { const t = useContext(I18nContext); diff --git a/ui/pages/institutional/confirm-add-institutional-feature/confirm-add-institutional-feature.js b/ui/pages/institutional/confirm-add-institutional-feature/confirm-add-institutional-feature.js index c07945e7c01e..3fbdfa3866f0 100644 --- a/ui/pages/institutional/confirm-add-institutional-feature/confirm-add-institutional-feature.js +++ b/ui/pages/institutional/confirm-add-institutional-feature/confirm-add-institutional-feature.js @@ -21,7 +21,10 @@ import { } from '../../../helpers/constants/design-system'; import Box from '../../../components/ui/box'; import { mmiActionsFactory } from '../../../store/institutional/institution-background'; -import { MetaMetricsEventCategory, MetaMetricsEventName } from '../../../../shared/constants/metametrics'; +import { + MetaMetricsEventCategory, + MetaMetricsEventName, +} from '../../../../shared/constants/metametrics'; export default function ConfirmAddInstitutionalFeature({ history }) { const t = useI18nContext(); diff --git a/ui/pages/institutional/custody/custody.js b/ui/pages/institutional/custody/custody.js index 76a44218858e..e6e935a5c17a 100644 --- a/ui/pages/institutional/custody/custody.js +++ b/ui/pages/institutional/custody/custody.js @@ -44,7 +44,10 @@ import { getCurrentChainId } from '../../../selectors'; import { getMMIConfiguration } from '../../../selectors/institutional/selectors'; import CustodyAccountList from '../connect-custody/account-list'; import JwtUrlForm from '../../../components/institutional/jwt-url-form'; -import { MetaMetricsEventCategory, MetaMetricsEventName } from '../../../../shared/constants/metametrics'; +import { + MetaMetricsEventCategory, + MetaMetricsEventName, +} from '../../../../shared/constants/metametrics'; const CustodyPage = () => { const t = useI18nContext(); From 265faf0a2b0586b51ea83cd1527c4ded29c7c6cc Mon Sep 17 00:00:00 2001 From: Antonio Regadas Date: Tue, 6 Jun 2023 15:35:52 +0100 Subject: [PATCH 3/6] adds necessary code fence --- .../app/signature-request/signature-request.component.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/components/app/signature-request/signature-request.component.js b/ui/components/app/signature-request/signature-request.component.js index 5cd645dc7973..261d58fd2ce3 100644 --- a/ui/components/app/signature-request/signature-request.component.js +++ b/ui/components/app/signature-request/signature-request.component.js @@ -12,7 +12,9 @@ import { } from '../../../helpers/utils/util'; import { MetaMetricsEventCategory, + ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) MetaMetricsEventName, + ///: END:ONLY_INCLUDE_IN } from '../../../../shared/constants/metametrics'; import SiteOrigin from '../../ui/site-origin'; import Button from '../../ui/button'; From 9eed7718b2bd3c1a6d943286ae2d4bd280b54ba7 Mon Sep 17 00:00:00 2001 From: Antonio Regadas Date: Tue, 13 Jun 2023 11:29:00 +0100 Subject: [PATCH 4/6] edits events names and title cases them --- shared/constants/metametrics.ts | 18 +++++++++--------- .../signature-request.component.js | 2 +- .../confirm-add-custodian-token.js | 6 +++--- .../confirm-add-institutional-feature.js | 2 +- ui/pages/institutional/custody/custody.js | 6 +++--- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/shared/constants/metametrics.ts b/shared/constants/metametrics.ts index acb73d5b265a..043ee6d5a77a 100644 --- a/shared/constants/metametrics.ts +++ b/shared/constants/metametrics.ts @@ -588,15 +588,15 @@ export enum MetaMetricsEventName { UserClickedPortfolioButton = 'Clicked Portfolio Button', UserClickedStakeButton = 'Clicked Stake Button', UserClickedCompliance = 'Clicked Compliance', - UserClickedRefreshTokenLink = 'User clicked refresh token link', - ShowDeeplinkForSignature = 'Show deeplink for signature', - CustodianOnboarding = 'Custodian onboarding', - InstitutionalFeatureConnection = 'Institutional feature connection', - CustodianSelected = 'Custodian selected', - ConnectCustodian = 'Connect to custodian', - ConnectCustodianCancel = 'Connect to custodian cancel', - ConnectCustodianError = 'Connect to custodian error', - CustodialAccountsConnected = 'Custodial accounts connected', + UserClickedRefreshTokenLink = 'User clicked Refresh Token Link', + ShowsDeeplinkForSignature = 'Shows Deeplink for Signature', + AddsCustodianTokenInOnboarding = 'Adds Custodian Token in Onboarding', + ConnectsInstitutionalFeature = 'Connects Institutional Feature', + CustodianSelected = 'Custodian Selected', + ConnectsToCustodian = 'Connects to Custodian', + ConnectionToCustodianCanceled = 'Connection to Custodian Canceled', + ConnectionToCustodianFailed = 'Connection to Custodian Failed', + CustodialAccountsConnected = 'Custodial Accounts Connected', ///: END:ONLY_INCLUDE_IN AccountDetailMenuOpened = 'Account Details Menu Opened', BlockExplorerLinkClicked = 'Block Explorer Clicked', diff --git a/ui/components/app/signature-request/signature-request.component.js b/ui/components/app/signature-request/signature-request.component.js index 261d58fd2ce3..8504becd81a4 100644 --- a/ui/components/app/signature-request/signature-request.component.js +++ b/ui/components/app/signature-request/signature-request.component.js @@ -128,7 +128,7 @@ export default class SignatureRequest extends PureComponent { onDeepLinkShown: () => { this.context.trackEvent({ category: MetaMetricsEventCategory.MMI, - event: MetaMetricsEventName.ShowDeeplinkForSignature, + event: MetaMetricsEventName.ShowsDeeplinkForSignature, }); }, }); diff --git a/ui/pages/institutional/confirm-add-custodian-token/confirm-add-custodian-token.js b/ui/pages/institutional/confirm-add-custodian-token/confirm-add-custodian-token.js index 935a8625841d..ad5fedacbb2d 100644 --- a/ui/pages/institutional/confirm-add-custodian-token/confirm-add-custodian-token.js +++ b/ui/pages/institutional/confirm-add-custodian-token/confirm-add-custodian-token.js @@ -100,7 +100,7 @@ const ConfirmAddCustodianToken = () => { trackEvent({ category: MetaMetricsEventCategory.MMI, - event: MetaMetricsEventName.CustodianOnboarding, + event: MetaMetricsEventName.AddsCustodianTokenInOnboarding, properties: { actions: 'Custodian RPC request', custodian: connectRequest.custodian, @@ -199,7 +199,7 @@ const ConfirmAddCustodianToken = () => { history.push(mostRecentOverviewPage); trackEvent({ category: MetaMetricsEventCategory.MMI, - event: MetaMetricsEventName.CustodianOnboarding, + event: MetaMetricsEventName.AddsCustodianTokenInOnboarding, properties: { actions: 'Custodian RPC cancel', custodian: connectRequest.custodian, @@ -247,7 +247,7 @@ const ConfirmAddCustodianToken = () => { }); trackEvent({ category: MetaMetricsEventCategory.MMI, - event: MetaMetricsEventName.CustodianOnboarding, + event: MetaMetricsEventName.AddsCustodianTokenInOnboarding, properties: { actions: 'Custodian RPC confirm', custodian: connectRequest.custodian, diff --git a/ui/pages/institutional/confirm-add-institutional-feature/confirm-add-institutional-feature.js b/ui/pages/institutional/confirm-add-institutional-feature/confirm-add-institutional-feature.js index 3fbdfa3866f0..f372b476848b 100644 --- a/ui/pages/institutional/confirm-add-institutional-feature/confirm-add-institutional-feature.js +++ b/ui/pages/institutional/confirm-add-institutional-feature/confirm-add-institutional-feature.js @@ -57,7 +57,7 @@ export default function ConfirmAddInstitutionalFeature({ history }) { const sendEvent = ({ actions, service }) => { trackEvent({ category: MetaMetricsEventCategory.MMI, - event: MetaMetricsEventName.InstitutionalFeatureConnection, + event: MetaMetricsEventName.ConnectsInstitutionalFeature, properties: { actions, service, diff --git a/ui/pages/institutional/custody/custody.js b/ui/pages/institutional/custody/custody.js index e6e935a5c17a..ccf4ec52e6d8 100644 --- a/ui/pages/institutional/custody/custody.js +++ b/ui/pages/institutional/custody/custody.js @@ -172,7 +172,7 @@ const CustodyPage = () => { ); trackEvent({ category: MetaMetricsEventCategory.MMI, - event: MetaMetricsEventName.ConnectCustodianError, + event: MetaMetricsEventName.ConnectionToCustodianFailed, properties: { custodian: selectedCustodianName, }, @@ -209,7 +209,7 @@ const CustodyPage = () => { setAccounts(accountsValue); trackEvent({ category: MetaMetricsEventCategory.MMI, - event: MetaMetricsEventName.ConnectCustodian, + event: MetaMetricsEventName.ConnectsToCustodian, properties: { custodian: selectedCustodianName, apiUrl, @@ -545,7 +545,7 @@ const CustodyPage = () => { trackEvent({ category: MetaMetricsEventCategory.MMI, - event: MetaMetricsEventName.ConnectCustodianCancel, + event: MetaMetricsEventName.ConnectionToCustodianCanceled, properties: { custodian: selectedCustodianName, numberOfAccounts: Object.keys(selectedAccounts).length, From 8d174af8253cf1cde93710ce500130cdd9eb9310 Mon Sep 17 00:00:00 2001 From: Antonio Regadas Date: Tue, 13 Jun 2023 12:08:07 +0100 Subject: [PATCH 5/6] edits events names --- shared/constants/metametrics.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shared/constants/metametrics.ts b/shared/constants/metametrics.ts index 043ee6d5a77a..e178d995cf47 100644 --- a/shared/constants/metametrics.ts +++ b/shared/constants/metametrics.ts @@ -584,10 +584,10 @@ export enum MetaMetricsEventName { WalletCreated = 'Wallet Created', ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) UserClickedDeepLink = 'User Clicked Deeplink', - UserClickedConnectCustodialAccount = 'Clicked Connect Custodial Account', - UserClickedPortfolioButton = 'Clicked Portfolio Button', - UserClickedStakeButton = 'Clicked Stake Button', - UserClickedCompliance = 'Clicked Compliance', + UserClickedConnectCustodialAccount = 'User Clicked Connect Custodial Account', + UserClickedPortfolioButton = 'User Clicked Portfolio Button', + UserClickedStakeButton = 'User Clicked Stake Button', + UserClickedCompliance = 'User Clicked Compliance', UserClickedRefreshTokenLink = 'User clicked Refresh Token Link', ShowsDeeplinkForSignature = 'Shows Deeplink for Signature', AddsCustodianTokenInOnboarding = 'Adds Custodian Token in Onboarding', From f672619c0509efaa70a434db3870b5738d406c41 Mon Sep 17 00:00:00 2001 From: Antonio Regadas Date: Fri, 14 Jul 2023 15:51:48 +0100 Subject: [PATCH 6/6] updates events according to segment-schema --- shared/constants/metametrics.ts | 23 +++++++++---------- .../signature-request.component.js | 2 +- .../app/wallet-overview/eth-overview.js | 4 ++-- .../custody-confirm-link-modal.js | 2 +- .../interactive-replacement-token-modal.js | 2 +- .../account-list-menu/account-list-menu.js | 2 +- .../multichain/global-menu/global-menu.js | 2 +- .../confirm-add-custodian-token.js | 6 ++--- .../confirm-add-institutional-feature.js | 2 +- ui/pages/institutional/custody/custody.js | 6 ++--- 10 files changed, 25 insertions(+), 26 deletions(-) diff --git a/shared/constants/metametrics.ts b/shared/constants/metametrics.ts index e178d995cf47..f69a091691b5 100644 --- a/shared/constants/metametrics.ts +++ b/shared/constants/metametrics.ts @@ -583,19 +583,18 @@ export enum MetaMetricsEventName { WalletSetupFailed = 'Wallet Setup Failed', WalletCreated = 'Wallet Created', ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) - UserClickedDeepLink = 'User Clicked Deeplink', - UserClickedConnectCustodialAccount = 'User Clicked Connect Custodial Account', - UserClickedPortfolioButton = 'User Clicked Portfolio Button', - UserClickedStakeButton = 'User Clicked Stake Button', - UserClickedCompliance = 'User Clicked Compliance', - UserClickedRefreshTokenLink = 'User clicked Refresh Token Link', - ShowsDeeplinkForSignature = 'Shows Deeplink for Signature', - AddsCustodianTokenInOnboarding = 'Adds Custodian Token in Onboarding', - ConnectsInstitutionalFeature = 'Connects Institutional Feature', + DeeplinkClicked = 'Deeplink Clicked', + ConnectCustodialAccountClicked = 'Connect Custodial Account Clicked', + MMIPortfolioButtonClicked = 'MMI Portfolio Button Clicked', + StakeButtonClicked = 'Stake Button Clicked', + ComplianceButtonClicked = 'Compliance Button Clicked', + RefreshTokenListClicked = 'Refresh Token List Clicked', + SignatureDeeplinkDisplayed = 'Signature Deeplink Displayed', + InstitutionalFeatureConnected = 'Institutional Feature Connected', CustodianSelected = 'Custodian Selected', - ConnectsToCustodian = 'Connects to Custodian', - ConnectionToCustodianCanceled = 'Connection to Custodian Canceled', - ConnectionToCustodianFailed = 'Connection to Custodian Failed', + CustodianConnected = 'Custodian Connected', + CustodianConnectionCanceled = 'Custodian Connection Canceled', + CustodianConnectionFailed = 'Custodian Connection Failed', CustodialAccountsConnected = 'Custodial Accounts Connected', ///: END:ONLY_INCLUDE_IN AccountDetailMenuOpened = 'Account Details Menu Opened', diff --git a/ui/components/app/signature-request/signature-request.component.js b/ui/components/app/signature-request/signature-request.component.js index 292f4dca946a..c0358b99d7e5 100644 --- a/ui/components/app/signature-request/signature-request.component.js +++ b/ui/components/app/signature-request/signature-request.component.js @@ -127,7 +127,7 @@ export default class SignatureRequest extends PureComponent { onDeepLinkShown: () => { this.context.trackEvent({ category: MetaMetricsEventCategory.MMI, - event: MetaMetricsEventName.ShowsDeeplinkForSignature, + event: MetaMetricsEventName.SignatureDeeplinkDisplayed, }); }, }); diff --git a/ui/components/app/wallet-overview/eth-overview.js b/ui/components/app/wallet-overview/eth-overview.js index 1499af24ef47..30133118227b 100644 --- a/ui/components/app/wallet-overview/eth-overview.js +++ b/ui/components/app/wallet-overview/eth-overview.js @@ -74,14 +74,14 @@ const EthOverview = ({ className, showAddress }) => { const portfolioEvent = () => { trackEvent({ category: MetaMetricsEventCategory.Navigation, - event: MetaMetricsEventName.UserClickedPortfolioButton, + event: MetaMetricsEventName.MMIPortfolioButtonClicked, }); }; const stakingEvent = () => { trackEvent({ category: MetaMetricsEventCategory.Navigation, - event: MetaMetricsEventName.UserClickedPortfolioButton, + event: MetaMetricsEventName.MMIPortfolioButtonClicked, }); }; diff --git a/ui/components/institutional/custody-confirm-link-modal/custody-confirm-link-modal.js b/ui/components/institutional/custody-confirm-link-modal/custody-confirm-link-modal.js index 36e1ef821f1a..f4486a44c6a0 100644 --- a/ui/components/institutional/custody-confirm-link-modal/custody-confirm-link-modal.js +++ b/ui/components/institutional/custody-confirm-link-modal/custody-confirm-link-modal.js @@ -62,7 +62,7 @@ const CustodyConfirmLink = () => { trackEvent({ category: MetaMetricsEventCategory.MMI, - event: MetaMetricsEventName.UserClickedDeepLink, + event: MetaMetricsEventName.DeeplinkClicked, }); dispatch(mmiActions.setWaitForConfirmDeepLinkDialog(false)); dispatch(hideModal()); diff --git a/ui/components/institutional/interactive-replacement-token-modal/interactive-replacement-token-modal.js b/ui/components/institutional/interactive-replacement-token-modal/interactive-replacement-token-modal.js index 744529602b95..eae1529f2add 100644 --- a/ui/components/institutional/interactive-replacement-token-modal/interactive-replacement-token-modal.js +++ b/ui/components/institutional/interactive-replacement-token-modal/interactive-replacement-token-modal.js @@ -60,7 +60,7 @@ const InteractiveReplacementTokenModal = () => { trackEvent({ category: MetaMetricsEventCategory.MMI, - event: MetaMetricsEventName.UserClickedRefreshTokenLink, + event: MetaMetricsEventName.ComplianceButtonClicked, }); }; diff --git a/ui/components/multichain/account-list-menu/account-list-menu.js b/ui/components/multichain/account-list-menu/account-list-menu.js index 4e942d823762..cdab704c2f9f 100644 --- a/ui/components/multichain/account-list-menu/account-list-menu.js +++ b/ui/components/multichain/account-list-menu/account-list-menu.js @@ -298,7 +298,7 @@ export const AccountListMenu = ({ onClose }) => { trackEvent({ category: MetaMetricsEventCategory.Navigation, event: - MetaMetricsEventName.UserClickedConnectCustodialAccount, + MetaMetricsEventName.ConnectCustodialAccountClicked, }); if (getEnvironmentType() === ENVIRONMENT_TYPE_POPUP) { global.platform.openExtensionInBrowser( diff --git a/ui/components/multichain/global-menu/global-menu.js b/ui/components/multichain/global-menu/global-menu.js index 50ff45780e8d..b0237233188e 100644 --- a/ui/components/multichain/global-menu/global-menu.js +++ b/ui/components/multichain/global-menu/global-menu.js @@ -112,7 +112,7 @@ export const GlobalMenu = ({ closeMenu, anchorElement }) => { onClick={() => { trackEvent({ category: MetaMetricsEventCategory.Navigation, - event: MetaMetricsEventName.UserClickedPortfolioButton, + event: MetaMetricsEventName.MMIPortfolioButtonClicked, }); window.open(mmiPortfolioUrl, '_blank'); closeMenu(); diff --git a/ui/pages/institutional/confirm-add-custodian-token/confirm-add-custodian-token.js b/ui/pages/institutional/confirm-add-custodian-token/confirm-add-custodian-token.js index b886473416a3..b5e9f48e5353 100644 --- a/ui/pages/institutional/confirm-add-custodian-token/confirm-add-custodian-token.js +++ b/ui/pages/institutional/confirm-add-custodian-token/confirm-add-custodian-token.js @@ -64,7 +64,7 @@ const ConfirmAddCustodianToken = () => { trackEvent({ category: MetaMetricsEventCategory.MMI, - event: MetaMetricsEventName.AddsCustodianTokenInOnboarding, + event: MetaMetricsEventName.TokenAdded, properties: { actions: 'Custodian RPC request', custodian: connectRequest.custodian, @@ -189,7 +189,7 @@ const ConfirmAddCustodianToken = () => { trackEvent({ category: MetaMetricsEventCategory.MMI, - event: MetaMetricsEventName.AddsCustodianTokenInOnboarding, + event: MetaMetricsEventName.TokenAdded, properties: { actions: 'Custodian RPC cancel', custodian: connectRequest.custodian, @@ -243,7 +243,7 @@ const ConfirmAddCustodianToken = () => { trackEvent({ category: MetaMetricsEventCategory.MMI, - event: MetaMetricsEventName.AddsCustodianTokenInOnboarding, + event: MetaMetricsEventName.TokenAdded, properties: { actions: 'Custodian RPC confirm', custodian: connectRequest.custodian, diff --git a/ui/pages/institutional/confirm-add-institutional-feature/confirm-add-institutional-feature.js b/ui/pages/institutional/confirm-add-institutional-feature/confirm-add-institutional-feature.js index f372b476848b..3ca021853e17 100644 --- a/ui/pages/institutional/confirm-add-institutional-feature/confirm-add-institutional-feature.js +++ b/ui/pages/institutional/confirm-add-institutional-feature/confirm-add-institutional-feature.js @@ -57,7 +57,7 @@ export default function ConfirmAddInstitutionalFeature({ history }) { const sendEvent = ({ actions, service }) => { trackEvent({ category: MetaMetricsEventCategory.MMI, - event: MetaMetricsEventName.ConnectsInstitutionalFeature, + event: MetaMetricsEventName.InstitutionalFeatureConnected, properties: { actions, service, diff --git a/ui/pages/institutional/custody/custody.js b/ui/pages/institutional/custody/custody.js index c4cc42be0544..33065bac26ce 100644 --- a/ui/pages/institutional/custody/custody.js +++ b/ui/pages/institutional/custody/custody.js @@ -196,7 +196,7 @@ const CustodyPage = () => { ); trackEvent({ category: MetaMetricsEventCategory.MMI, - event: MetaMetricsEventName.ConnectionToCustodianFailed, + event: MetaMetricsEventName.CustodianConnectionFailed, properties: { custodian: selectedCustodianName, }, @@ -229,7 +229,7 @@ const CustodyPage = () => { setAccounts(accountsValue); trackEvent({ category: MetaMetricsEventCategory.MMI, - event: MetaMetricsEventName.ConnectsToCustodian, + event: MetaMetricsEventName.CustodianConnected, properties: { custodian: selectedCustodianName, apiUrl, @@ -591,7 +591,7 @@ const CustodyPage = () => { trackEvent({ category: MetaMetricsEventCategory.MMI, - event: MetaMetricsEventName.ConnectionToCustodianCanceled, + event: MetaMetricsEventName.CustodianConnectionCanceled, properties: { custodian: selectedCustodianName, numberOfAccounts: Object.keys(selectedAccounts).length,