Repository navigation
feat: send the mParticle session ID to Branch - #959
alexs-mparticle merged 3 commits into
Conversation
Adds the current session UUID to the custom data of every event the Branch kit logs, under mp_session_uuid, so events Branch reports back can be matched to the original event. Skipped when there is no current session; a customer attribute with the same key is not overwritten. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The numeric session ID is the value mParticle exposes for the session in its data exports, so sending it lets Branch-reported events be matched without re-hashing the UUID. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alexs-mparticle
left a comment
There was a problem hiding this comment.
Requesting changes. The code looks correct, but two things have to happen before merge:
- CI hasn't run. "Build and Test" on
a80a7a0isaction_requiredbecause this is a fork PR waiting for maintainer approval, so the new tests haven't executed. - Sign-off on sending the session ID by default. See the inline comment on
addSessionId.
For the release PR: the Kits → Branch entry should say that Branch events now carry mp_session_id.
Not blocking: the tests call addSessionId directly, so removing it from logEvent, logEvent(CommerceEvent) or logScreen would still pass.
Question: which field in the mParticle data export did you match a real mp_session_id against? The numeric ID fits the core SDK's documented contract, but the server side isn't in this repo, so I couldn't confirm the match.
I checked parity with mParticle/mparticle-apple-sdk#1157: same key, same value, same event paths, and a customer attribute wins on both.
Reads the sendSessionId connection setting, off by default, and adds the ID through a BranchEvent.withSessionId extension. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Should have all the changes in. I confirmed the kit sends the same numeric session ID the core SDK reports, and I checked it against sample production event batches: the session_id in the data export matched on every event. |
Adds the current mParticle session ID (the numeric
sessionID) to the custom data of events the Branch kit logs, undermp_session_id, so events Branch reports back can be matched to the original event. It's opt-in: sent only when the connection'ssendSessionIdsetting is enabled, which is off by default. Skipped when there is no current session, and a customer attribute with the same key is not overwritten.Limits: the value is per session, not per event, so matching still needs event name and timestamp. It is read when the event reaches the kit, so an event at a session boundary, or replayed after a delayed first-launch config, can carry the next session or none. Only app builds with this kit version send it, and Branch must return custom data for the match to work.
🤖 Generated with Claude Code