diff --git a/app/scripts/controllers/metametrics.js b/app/scripts/controllers/metametrics.js index d815607d27e8..d799249bb71b 100644 --- a/app/scripts/controllers/metametrics.js +++ b/app/scripts/controllers/metametrics.js @@ -837,6 +837,7 @@ export default class MetaMetricsController { metamaskState.useTokenDetection, [MetaMetricsUserTrait.UseNativeCurrencyAsPrimaryCurrency]: metamaskState.useNativeCurrencyAsPrimaryCurrency, + [MetaMetricsUserTrait.CurrentCurrency]: metamaskState.currentCurrency, ///: BEGIN:ONLY_INCLUDE_IF(build-mmi) [MetaMetricsUserTrait.MmiExtensionId]: this.extension?.runtime?.id, [MetaMetricsUserTrait.MmiAccountAddress]: mmiAccountAddress, diff --git a/shared/constants/metametrics.ts b/shared/constants/metametrics.ts index daec305bfb11..0ad1bc9e1deb 100644 --- a/shared/constants/metametrics.ts +++ b/shared/constants/metametrics.ts @@ -468,6 +468,10 @@ export enum MetaMetricsUserTrait { MmiIsCustodian = 'mmi_is_custodian', ///: END:ONLY_INCLUDE_IF PetnameAddressCount = 'petname_addresses_count', + /** + * Identified when the user selects a currency from settings + */ + CurrentCurrency = 'current_currency', } /** @@ -514,6 +518,7 @@ export enum MetaMetricsEventName { BridgeLinkClicked = 'Bridge Link Clicked', BitcoinSupportToggled = 'Bitcoin Support Toggled', BitcoinTestnetSupportToggled = 'Bitcoin Testnet Support Toggled', + CurrentCurrency = 'Current Currency', DappViewed = 'Dapp Viewed', DecryptionApproved = 'Decryption Approved', DecryptionRejected = 'Decryption Rejected', diff --git a/ui/pages/settings/settings-tab/settings-tab.component.js b/ui/pages/settings/settings-tab/settings-tab.component.js index 45407ece008d..d798b62f77ba 100644 --- a/ui/pages/settings/settings-tab/settings-tab.component.js +++ b/ui/pages/settings/settings-tab/settings-tab.component.js @@ -119,7 +119,16 @@ export default class SettingsTab extends PureComponent { id="select-currency" options={currencyOptions} selectedOption={currentCurrency} - onChange={(newCurrency) => setCurrentCurrency(newCurrency)} + onChange={(newCurrency) => { + setCurrentCurrency(newCurrency); + this.context.trackEvent({ + category: MetaMetricsEventCategory.Settings, + event: MetaMetricsEventName.CurrentCurrency, + properties: { + current_currency: newCurrency, + }, + }); + }} />