Skip to content

Commit

Permalink
fix: Add metric trait for privacy mode
Browse files Browse the repository at this point in the history
  • Loading branch information
darkwing committed Nov 6, 2024
1 parent 264a432 commit 518c0c8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/scripts/controllers/metametrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ export type MetaMaskState = {
security_providers: string[];
addressBook: AddressBookControllerState['addressBook'];
currentCurrency: string;
preferences: {
privacyMode: PreferencesControllerState['preferences']['privacyMode'];
};
///: BEGIN:ONLY_INCLUDE_IF(build-mmi)
custodyAccountDetails: {
[address: string]: {
Expand Down Expand Up @@ -1089,6 +1092,8 @@ export default class MetaMetricsController {
metamaskState.dataCollectionForMarketing,
[MetaMetricsUserTrait.TokenSortPreference]:
metamaskState.tokenSortConfig?.key || '',
[MetaMetricsUserTrait.PrivacyModeEnabled]:
metamaskState.preferences.privacyMode,
};

if (!previousUserTraits) {
Expand Down
4 changes: 4 additions & 0 deletions shared/constants/metametrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,10 @@ export enum MetaMetricsUserTrait {
* Identified when the user changes token sort order on asset-list
*/
TokenSortPreference = 'token_sort_preference',
/**
* Identifies if the Privacy Mode is enabled
*/
PrivacyModeEnabled = 'privacy_mode_toggle',
}

/**
Expand Down

0 comments on commit 518c0c8

Please sign in to comment.