feat: forward allowlisted Segment events to Braze [GE-165] [GE-190]#28805
Conversation
|
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. |
7e9bc1d to
af5300b
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #28805 +/- ##
==========================================
+ Coverage 82.20% 82.24% +0.03%
==========================================
Files 5017 5030 +13
Lines 131659 132129 +470
Branches 29381 29496 +115
==========================================
+ Hits 108228 108663 +435
- Misses 16083 16099 +16
- Partials 7348 7367 +19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3a2e67f. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
SmokeIdentity is selected because the changes directly touch the identity sign-in/sign-out flow (useBrazeIdentity, useIdentityEffects), account syncing infrastructure, and the profile ID management that underpins identity features. SmokeWalletPlatform is selected because it covers wallet lifecycle analytics tracking (new wallet creation, SRP import events) and the analytics controller initialization changes could affect how analytics events are tracked during wallet lifecycle events. It also covers multi-SRP architecture which intersects with the identity changes. Other tags (SmokeConfirmations, SmokeTrade, etc.) are not selected because the changes are analytics infrastructure with proper E2E guards, and don't touch transaction flows, network management, or other feature-specific code paths. Performance Test Selection: |
|
✅ E2E Fixture Validation — Schema is up to date |
|
ccharly
left a comment
There was a problem hiding this comment.
LGTM for accounts (not tested)




Description
Enables Braze events tracking via Segment’s device-mode pipeline by adding a custom BrazePlugin that identifies users via MetaMask profileId, forwards only allowlisted track events and identify traits via the Braze SDK.
Allowlisted events are managed on LaunchDarkly with a feature flag, so that we can update them without having to do a new release
A custom BrazePlugin was used instead of Segment's one for 2 reasons:
identifycalls use the Metametrics ID, while we needed to use the profile ID in Braze. The base plugin was instead copying Segment's ID for BrazeChangelog
CHANGELOG entry:
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/GE-165
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes the analytics pipeline and remote-config-driven allowlisting, which can affect what data is sent to Braze and when. Incorrect flag values or identity syncing issues could lead to dropped/extra analytics events or misattribution.
Overview
Routes Braze tracking through Segment device-mode by introducing a custom
BrazePlugindestination plugin that gatestrackevents andidentifytraits behind configurable allowlists and aprofileIdguard, and adds support for forwarding language/flush calls to the native Braze SDK.Updates the public Braze API (
app/core/Braze/index.ts) to manage a singleton plugin, set/clear Braze identity on sign-in/sign-out, keep Braze language in sync with locale changes, and validate/apply allowlists from a new remote feature flag.Wires the plugin into analytics initialization by extending
createPlatformAdapterto accept optional Segment plugins, subscribinganalytics-controller-init.tsto remote feature flag updates (and an initial fetch), and adds a new init messenger plus Jest/test/mocks and feature-flag registry entries to support this behavior.Reviewed by Cursor Bugbot for commit e248adf. Bugbot is set up for automated code reviews on this repo. Configure here.