feat(perps-controller): add perps_mode analytics property for Lite/Pro UI - #9819
Open
michalconsensys wants to merge 1 commit into
Open
feat(perps-controller): add perps_mode analytics property for Lite/Pro UI#9819michalconsensys wants to merge 1 commit into
michalconsensys wants to merge 1 commit into
Conversation
…o UI Keep existing MODE as search intent so clients can attribute events by interface mode without colliding with discovery/intent/browse.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
Clients need to attribute Perps analytics events by Lite/Pro interface mode (
'lite' | 'pro'). Search already usesPERPS_EVENT_PROPERTY.MODE(mode) for search intent (discovery/intent/browse), so reusing that key would collide and break dashboards.This PR adds
PERPS_EVENT_PROPERTY.PERPS_MODE = 'perps_mode'in@metamask/perps-controllerso mobile and extension can import a single shared key for Lite/Pro UI mode. ExistingMODEis left unchanged and clarified with a comment. Tests and the package changelog are updated accordingly.References
N/A
Checklist
Note
Low Risk
Additive analytics constant only; no runtime or breaking API changes beyond a new optional event property key.
Overview
Adds a shared analytics property key so mobile and extension can tag Perps events with Lite vs Pro UI mode without reusing search’s
modefield.PERPS_EVENT_PROPERTY.PERPS_MODE(perps_mode) is introduced for values'lite' | 'pro'.MODE(mode) is unchanged and documented as search intent only (discovery/intent/browse). Changelog and unit tests cover the new export.Reviewed by Cursor Bugbot for commit b92e5e9. Bugbot is set up for automated code reviews on this repo. Configure here.