Skip to content

feat(perps-controller): add perps_mode analytics property for Lite/Pro UI - #9819

Open
michalconsensys wants to merge 1 commit into
mainfrom
feat/core-perps-mode-analytics-property
Open

feat(perps-controller): add perps_mode analytics property for Lite/Pro UI#9819
michalconsensys wants to merge 1 commit into
mainfrom
feat/core-perps-mode-analytics-property

Conversation

@michalconsensys

@michalconsensys michalconsensys commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Explanation

Clients need to attribute Perps analytics events by Lite/Pro interface mode ('lite' | 'pro'). Search already uses PERPS_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-controller so mobile and extension can import a single shared key for Lite/Pro UI mode. Existing MODE is left unchanged and clarified with a comment. Tests and the package changelog are updated accordingly.

References

N/A

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

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 mode field.

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.

…o UI

Keep existing MODE as search intent so clients can attribute events by interface mode without colliding with discovery/intent/browse.
@michalconsensys
michalconsensys requested review from a team as code owners August 11, 2026 08:46
@michalconsensys
michalconsensys deployed to default-branch August 11, 2026 08:46 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant