-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
What is this about?
The Identify analytics call introduced in PR #24178 sends a very large and unfiltered set of feature flags and remote config data as user traits. This results Identify call not reaching segment (no Identify on https://app.segment.com/consensys-analytics/sources/raw_segment_metamask_mobile_dev/debugger)
Plus if they did, it would be noisy, hard-to-use analytics data and potential performance concerns.
Additionally, Identify event traits must be explicitly declared in the Segment tracking plan schema. Any trait sent that is not defined in the MetaMask Mobile Segment schema is undocumented, unvalidated, and will eventually be filtered out and unavailable in downstream data stores.
Schema reference:
https://github.com/Consensys/segment-schema/blob/main/tracking-plans/metamask-mobile.yaml#L24
Scenario
- GIVEN the app initializes analytics
- WHEN an Identify event is sent
- THEN only meaningful, intentional, schema-declared, and analytics-usable traits should be included
Design
No response
Technical Details
-
Current behavior
- The Identify event includes the full feature flag / remote config object.
- Payload contains deeply nested objects and large maps (e.g.
smartTransactionsNetworks, per-chain configs, allowlists, blocklists). - Many traits resolve to
[Object]in analytics tools and are not queryable or actionable. - Traits are sent without being declared in the Segment tracking plan and will not be retained long term.
-
Concerns
- Analytics noise and unusable traits.
- Increased payload size for Identify calls.
- Segment tracking plan contract is not enforced.
- Traits not declared in the schema will be dropped and unavailable for analysis.
-
Suggested direction
- Explicitly whitelist and send only actively used feature flags.
- Declare every Identify trait in the Segment schema.
- Exclude remote config and large structured objects.
- Add traits individually instead of passing entire objects.
- Align expectations on schema and usage.
Threat Modeling Framework
-
What are we working on?
Reducing and formalizing Identify analytics payloads to ensure signal > noise and schema compliance. -
What can go wrong?
- Over-collection of irrelevant or undocumented data
- Loss of data due to schema filtering
- Silent schema drift
-
What are we going to do about it?
- Enforce schema alignment
- Reduce and explicitly define traits
- Add cross-team review where needed
-
Did we do a good job?
Confirmed when all Identify traits are declared, retained, and usable in analytics.
Acceptance Criteria
- Identify event payload contains only whitelisted traits.
- Every Identify trait is declared in the Segment tracking plan.
- Undeclared traits are not sent.
- Remote config and large nested objects are excluded.
- Traits are queryable and retained in analytics data stores.
- No regression in analytics behavior or app stability.
Stakeholder review needed before the work gets merged
- Engineering (needed in most cases)
- Design
- Product
- QA (automation tests are required to pass before merging PRs but not all changes are covered by automation tests - please review if QA is needed beyond automation tests)
- Security
- Legal
- Marketing
- Management (please specify)
- Data team