Skip to content

Commit

Permalink
updates events according to segment-schema
Browse files Browse the repository at this point in the history
  • Loading branch information
zone-live committed Jul 14, 2023
1 parent da2b20a commit f672619
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 26 deletions.
23 changes: 11 additions & 12 deletions shared/constants/metametrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export default class SignatureRequest extends PureComponent {
onDeepLinkShown: () => {
this.context.trackEvent({
category: MetaMetricsEventCategory.MMI,
event: MetaMetricsEventName.ShowsDeeplinkForSignature,
event: MetaMetricsEventName.SignatureDeeplinkDisplayed,
});
},
});
Expand Down
4 changes: 2 additions & 2 deletions ui/components/app/wallet-overview/eth-overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const CustodyConfirmLink = () => {

trackEvent({
category: MetaMetricsEventCategory.MMI,
event: MetaMetricsEventName.UserClickedDeepLink,
event: MetaMetricsEventName.DeeplinkClicked,
});
dispatch(mmiActions.setWaitForConfirmDeepLinkDialog(false));
dispatch(hideModal());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const InteractiveReplacementTokenModal = () => {

trackEvent({
category: MetaMetricsEventCategory.MMI,
event: MetaMetricsEventName.UserClickedRefreshTokenLink,
event: MetaMetricsEventName.ComplianceButtonClicked,
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion ui/components/multichain/global-menu/global-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const ConfirmAddCustodianToken = () => {

trackEvent({
category: MetaMetricsEventCategory.MMI,
event: MetaMetricsEventName.AddsCustodianTokenInOnboarding,
event: MetaMetricsEventName.TokenAdded,
properties: {
actions: 'Custodian RPC request',
custodian: connectRequest.custodian,
Expand Down Expand Up @@ -189,7 +189,7 @@ const ConfirmAddCustodianToken = () => {

trackEvent({
category: MetaMetricsEventCategory.MMI,
event: MetaMetricsEventName.AddsCustodianTokenInOnboarding,
event: MetaMetricsEventName.TokenAdded,
properties: {
actions: 'Custodian RPC cancel',
custodian: connectRequest.custodian,
Expand Down Expand Up @@ -243,7 +243,7 @@ const ConfirmAddCustodianToken = () => {

trackEvent({
category: MetaMetricsEventCategory.MMI,
event: MetaMetricsEventName.AddsCustodianTokenInOnboarding,
event: MetaMetricsEventName.TokenAdded,
properties: {
actions: 'Custodian RPC confirm',
custodian: connectRequest.custodian,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions ui/pages/institutional/custody/custody.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ const CustodyPage = () => {
);
trackEvent({
category: MetaMetricsEventCategory.MMI,
event: MetaMetricsEventName.ConnectionToCustodianFailed,
event: MetaMetricsEventName.CustodianConnectionFailed,
properties: {
custodian: selectedCustodianName,
},
Expand Down Expand Up @@ -229,7 +229,7 @@ const CustodyPage = () => {
setAccounts(accountsValue);
trackEvent({
category: MetaMetricsEventCategory.MMI,
event: MetaMetricsEventName.ConnectsToCustodian,
event: MetaMetricsEventName.CustodianConnected,
properties: {
custodian: selectedCustodianName,
apiUrl,
Expand Down Expand Up @@ -591,7 +591,7 @@ const CustodyPage = () => {

trackEvent({
category: MetaMetricsEventCategory.MMI,
event: MetaMetricsEventName.ConnectionToCustodianCanceled,
event: MetaMetricsEventName.CustodianConnectionCanceled,
properties: {
custodian: selectedCustodianName,
numberOfAccounts: Object.keys(selectedAccounts).length,
Expand Down

0 comments on commit f672619

Please sign in to comment.