diff --git a/shared/constants/metametrics.ts b/shared/constants/metametrics.ts index 9e7fdbe1f..1371a451d 100644 --- a/shared/constants/metametrics.ts +++ b/shared/constants/metametrics.ts @@ -586,6 +586,8 @@ export enum MetaMetricsEventName { DeeplinkClicked = 'Deeplink Clicked', ConnectCustodialAccountClicked = 'Connect Custodial Account Clicked', MMIPortfolioButtonClicked = 'MMI Portfolio Button Clicked', + PortfolioDashboardModalButtonClicked = 'Portfolio Dashboard Modal Button Clicked', + PortfolioDashboardModalOpened = 'Portfolio Dashboard Modal Opened', StakeButtonClicked = 'Stake Button Clicked', InteractiveReplacementTokenButtonClicked = 'Interactive Replacement Token Button Clicked', RefreshTokenListClicked = 'Refresh Token List Clicked', diff --git a/ui/components/app/whats-new-popup/whats-new-popup.js b/ui/components/app/whats-new-popup/whats-new-popup.js index 09e26129f..fb4ea7286 100644 --- a/ui/components/app/whats-new-popup/whats-new-popup.js +++ b/ui/components/app/whats-new-popup/whats-new-popup.js @@ -347,10 +347,26 @@ export default function WhatsNewPopup({ observer.observe(ref.current); }); + ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) + trackEvent({ + category: MetaMetricsEventCategory.MMI, + event: MetaMetricsEventName.MMIPortfolioDashboardModalOpen, + properties: { + action: 'Modal was opened', + }, + }); + ///: END:ONLY_INCLUDE_IN + return () => { observer.disconnect(); }; - }, [idRefMap, setSeenNotifications]); + }, [ + idRefMap, + setSeenNotifications, + ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) + trackEvent, + ///: END:ONLY_INCLUDE_IN + ]); // Display the swaps notification with full image // Displays the NFTs & OpenSea notifications 18,19 with full image @@ -377,6 +393,15 @@ export default function WhatsNewPopup({ completed_all: true, }, }); + ///: BEGIN:ONLY_INCLUDE_IN(build-mmi) + trackEvent({ + category: MetaMetricsEventCategory.MMI, + event: MetaMetricsEventName.MMIPortfolioDashboardModalButton, + properties: { + action: 'Button was clicked', + }, + }); + ///: END:ONLY_INCLUDE_IN onClose(); }} popoverRef={popoverRef}