Skip to content

fix(analytics): fix user traits types to match Segment schema#27838

Open
skyc1e wants to merge 1 commit intoMetaMask:mainfrom
skyc1e:fix/analytics-user-traits-types
Open

fix(analytics): fix user traits types to match Segment schema#27838
skyc1e wants to merge 1 commit intoMetaMask:mainfrom
skyc1e:fix/analytics-user-traits-types

Conversation

@skyc1e
Copy link
Copy Markdown

@skyc1e skyc1e commented Mar 24, 2026

Description

Found that security_providers and has_marketing_consent traits are causing Segment schema violations because they're being sent as strings instead of the expected types.

Fixed both:

  • security_providers now returns ['blockaid'] / [] instead of 'blockaid' / ''
  • has_marketing_consent now returns actual true/false instead of 'ON'/'OFF'

Also updated the UserProfileMetaData interface and tests to reflect this.

Related Issue

Resolves #23970

Testing

Existing unit tests updated - all assertions now check for correct types.
No UI changes involved.


Note

Medium Risk
Changes the runtime shape of analytics identify traits (security_providers and has_marketing_consent), which could affect downstream analytics consumers expecting the previous string values, but is limited to metrics payload formatting.

Overview
Fixes Segment identify trait type mismatches by sending correctly typed user profile traits.

security_providers is now emitted as a string array (e.g. ['blockaid']/[]) and has_marketing_consent is now a boolean (true/false), with the UserProfileMetaData types and unit tests updated accordingly.

Written by Cursor Bugbot for commit 1950255. This will update automatically on new commits. Configure here.

Update security_providers from string to string array and
has_marketing_consent from string to boolean to resolve
Segment schema violations in identify calls.
@skyc1e skyc1e requested a review from a team as a code owner March 24, 2026 01:27
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 24, 2026

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@skyc1e
Copy link
Copy Markdown
Author

skyc1e commented Mar 24, 2026

I have read the CLA Document and I hereby sign the CLA

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.

fix(analytics): fix user traits types violations

1 participant