mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-21 17:37:01 +01:00
[MMI] adds segment events to Metametrics constants (#19468)
* adds metametrics enums * prettier * adds necessary code fence * edits events names and title cases them * edits events names * updates events according to segment-schema
This commit is contained in:
parent
e105a6030e
commit
f8bfb6cff5
@ -583,10 +583,19 @@ export enum MetaMetricsEventName {
|
||||
WalletSetupFailed = 'Wallet Setup Failed',
|
||||
WalletCreated = 'Wallet Created',
|
||||
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
|
||||
UserClickedDeepLink = 'User Clicked Deeplink',
|
||||
UserClickedConnectCustodialAccount = 'Clicked Connect Custodial Account',
|
||||
UserClickedPortfolioButton = 'Clicked Portfolio Button',
|
||||
UserClickedCompliance = 'Clicked Compliance',
|
||||
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',
|
||||
CustodianConnected = 'Custodian Connected',
|
||||
CustodianConnectionCanceled = 'Custodian Connection Canceled',
|
||||
CustodianConnectionFailed = 'Custodian Connection Failed',
|
||||
CustodialAccountsConnected = 'Custodial Accounts Connected',
|
||||
///: END:ONLY_INCLUDE_IN
|
||||
AccountDetailMenuOpened = 'Account Details Menu Opened',
|
||||
BlockExplorerLinkClicked = 'Block Explorer Clicked',
|
||||
|
@ -11,7 +11,12 @@ import {
|
||||
shortenAddress,
|
||||
///: END:ONLY_INCLUDE_IN
|
||||
} from '../../../helpers/utils/util';
|
||||
import { MetaMetricsEventCategory } from '../../../../shared/constants/metametrics';
|
||||
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';
|
||||
import ContractDetailsModal from '../modals/contract-details-modal/contract-details-modal';
|
||||
@ -121,8 +126,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.SignatureDeeplinkDisplayed,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
@ -73,15 +73,15 @@ const EthOverview = ({ className, showAddress }) => {
|
||||
|
||||
const portfolioEvent = () => {
|
||||
trackEvent({
|
||||
category: 'Navigation',
|
||||
event: 'Clicked Portfolio Button',
|
||||
category: MetaMetricsEventCategory.Navigation,
|
||||
event: MetaMetricsEventName.MMIPortfolioButtonClicked,
|
||||
});
|
||||
};
|
||||
|
||||
const stakingEvent = () => {
|
||||
trackEvent({
|
||||
category: 'Navigation',
|
||||
event: 'Clicked Stake Button',
|
||||
category: MetaMetricsEventCategory.Navigation,
|
||||
event: MetaMetricsEventName.MMIPortfolioButtonClicked,
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -70,7 +70,7 @@ const CustodyConfirmLink = ({ hideModal }) => {
|
||||
|
||||
trackEvent({
|
||||
category: MetaMetricsEventCategory.MMI,
|
||||
event: MetaMetricsEventName.UserClickedDeepLink,
|
||||
event: MetaMetricsEventName.DeeplinkClicked,
|
||||
});
|
||||
dispatch(mmiActions.setWaitForConfirmDeepLinkDialog(false));
|
||||
dispatch(hideModal());
|
||||
|
@ -26,6 +26,10 @@ import {
|
||||
TextAlign,
|
||||
AlignItems,
|
||||
} from '../../../helpers/constants/design-system';
|
||||
import {
|
||||
MetaMetricsEventCategory,
|
||||
MetaMetricsEventName,
|
||||
} from '../../../../shared/constants/metametrics';
|
||||
|
||||
const InteractiveReplacementTokenModal = () => {
|
||||
const t = useI18nContext();
|
||||
@ -55,8 +59,8 @@ const InteractiveReplacementTokenModal = () => {
|
||||
});
|
||||
|
||||
trackEvent({
|
||||
category: 'MMI',
|
||||
event: 'User clicked refresh token link',
|
||||
category: MetaMetricsEventCategory.MMI,
|
||||
event: MetaMetricsEventName.ComplianceButtonClicked,
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -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(
|
||||
|
@ -113,7 +113,7 @@ export const GlobalMenu = ({ closeMenu, anchorElement }) => {
|
||||
onClick={() => {
|
||||
trackEvent({
|
||||
category: MetaMetricsEventCategory.Navigation,
|
||||
event: MetaMetricsEventName.UserClickedPortfolioButton,
|
||||
event: MetaMetricsEventName.MMIPortfolioButtonClicked,
|
||||
});
|
||||
window.open(mmiPortfolioUrl, '_blank');
|
||||
closeMenu();
|
||||
|
@ -26,6 +26,10 @@ import {
|
||||
Box,
|
||||
} from '../../../components/component-library';
|
||||
import { Text } from '../../../components/component-library/text/deprecated';
|
||||
import {
|
||||
MetaMetricsEventCategory,
|
||||
MetaMetricsEventName,
|
||||
} from '../../../../shared/constants/metametrics';
|
||||
import {
|
||||
complianceActivated,
|
||||
getInstitutionalConnectRequests,
|
||||
@ -59,8 +63,8 @@ const ConfirmAddCustodianToken = () => {
|
||||
}
|
||||
|
||||
trackEvent({
|
||||
category: 'MMI',
|
||||
event: 'Custodian onboarding',
|
||||
category: MetaMetricsEventCategory.MMI,
|
||||
event: MetaMetricsEventName.TokenAdded,
|
||||
properties: {
|
||||
actions: 'Custodian RPC request',
|
||||
custodian: connectRequest.custodian,
|
||||
@ -184,8 +188,8 @@ const ConfirmAddCustodianToken = () => {
|
||||
);
|
||||
|
||||
trackEvent({
|
||||
category: 'MMI',
|
||||
event: 'Custodian onboarding',
|
||||
category: MetaMetricsEventCategory.MMI,
|
||||
event: MetaMetricsEventName.TokenAdded,
|
||||
properties: {
|
||||
actions: 'Custodian RPC cancel',
|
||||
custodian: connectRequest.custodian,
|
||||
@ -238,8 +242,8 @@ const ConfirmAddCustodianToken = () => {
|
||||
);
|
||||
|
||||
trackEvent({
|
||||
category: 'MMI',
|
||||
event: 'Custodian onboarding',
|
||||
category: MetaMetricsEventCategory.MMI,
|
||||
event: MetaMetricsEventName.TokenAdded,
|
||||
properties: {
|
||||
actions: 'Custodian RPC confirm',
|
||||
custodian: connectRequest.custodian,
|
||||
|
@ -21,6 +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';
|
||||
|
||||
export default function ConfirmAddInstitutionalFeature({ history }) {
|
||||
const t = useI18nContext();
|
||||
@ -52,8 +56,8 @@ export default function ConfirmAddInstitutionalFeature({ history }) {
|
||||
|
||||
const sendEvent = ({ actions, service }) => {
|
||||
trackEvent({
|
||||
category: 'MMI',
|
||||
event: 'Institutional feature connection',
|
||||
category: MetaMetricsEventCategory.MMI,
|
||||
event: MetaMetricsEventName.InstitutionalFeatureConnected,
|
||||
properties: {
|
||||
actions,
|
||||
service,
|
||||
|
@ -44,6 +44,10 @@ import { getCurrentChainId, getSelectedAddress } 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 PulseLoader from '../../../components/ui/pulse-loader/pulse-loader';
|
||||
|
||||
const CustodyPage = () => {
|
||||
@ -141,8 +145,8 @@ const CustodyPage = () => {
|
||||
setCurrentJwt(jwtListValue[0] || '');
|
||||
setJwtList(jwtListValue);
|
||||
trackEvent({
|
||||
category: 'MMI',
|
||||
event: 'Custodian Selected',
|
||||
category: MetaMetricsEventCategory.MMI,
|
||||
event: MetaMetricsEventName.CustodianSelected,
|
||||
properties: {
|
||||
custodian: custodian.name,
|
||||
},
|
||||
@ -192,8 +196,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.CustodianConnectionFailed,
|
||||
properties: {
|
||||
custodian: selectedCustodianName,
|
||||
},
|
||||
@ -225,8 +229,8 @@ const CustodyPage = () => {
|
||||
|
||||
setAccounts(accountsValue);
|
||||
trackEvent({
|
||||
category: 'MMI',
|
||||
event: 'Connect to custodian',
|
||||
category: MetaMetricsEventCategory.MMI,
|
||||
event: MetaMetricsEventName.CustodianConnected,
|
||||
properties: {
|
||||
custodian: selectedCustodianName,
|
||||
apiUrl,
|
||||
@ -553,8 +557,8 @@ const CustodyPage = () => {
|
||||
);
|
||||
|
||||
trackEvent({
|
||||
category: 'MMI',
|
||||
event: 'Custodial accounts connected',
|
||||
category: MetaMetricsEventCategory.MMI,
|
||||
event: MetaMetricsEventName.CustodialAccountsConnected,
|
||||
properties: {
|
||||
custodian: selectedCustodianName,
|
||||
numberOfAccounts: Object.keys(selectedAccounts).length,
|
||||
@ -588,8 +592,8 @@ const CustodyPage = () => {
|
||||
}
|
||||
|
||||
trackEvent({
|
||||
category: 'MMI',
|
||||
event: 'Connect to custodian cancel',
|
||||
category: MetaMetricsEventCategory.MMI,
|
||||
event: MetaMetricsEventName.CustodianConnectionCanceled,
|
||||
properties: {
|
||||
custodian: selectedCustodianName,
|
||||
numberOfAccounts: Object.keys(selectedAccounts).length,
|
||||
|
Loading…
Reference in New Issue
Block a user