Skip to content

feat: send the mParticle session ID to Branch - #959

Merged
alexs-mparticle merged 3 commits into
mParticle:mainfrom
william-randolph-rokt:feat/branch-kit-session-uuid
Oct 22, 2026
Merged

alexs-mparticle merged 3 commits into
mParticle:mainfrom
william-randolph-rokt:feat/branch-kit-session-uuid

Conversation

@william-randolph-rokt

@william-randolph-rokt william-randolph-rokt commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Adds the current mParticle session ID (the numeric sessionID) to the custom data of events the Branch kit logs, under mp_session_id, so events Branch reports back can be matched to the original event. It's opt-in: sent only when the connection's sendSessionId setting 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

william-randolph-rokt and others added 2 commits October 20, 2026 14:28
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>
@william-randolph-rokt william-randolph-rokt changed the title feat: send the mParticle session UUID to Branch feat: send the mParticle session ID to Branch Oct 21, 2026
@william-randolph-rokt
william-randolph-rokt marked this pull request as ready for review October 21, 2026 17:11
@william-randolph-rokt
william-randolph-rokt requested a review from a team as a code owner October 21, 2026 17:11

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@alexs-mparticle alexs-mparticle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes. The code looks correct, but two things have to happen before merge:

  1. CI hasn't run. "Build and Test" on a80a7a0 is action_required because this is a fork PR waiting for maintainer approval, so the new tests haven't executed.
  2. 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.

Comment thread kits/branch/branch-5/src/main/kotlin/com/mparticle/kits/BranchMetricsKit.kt Outdated
Comment thread kits/branch/branch-5/src/main/kotlin/com/mparticle/kits/BranchMetricsKit.kt Outdated
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>
@william-randolph-rokt

Copy link
Copy Markdown
Contributor Author

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.

@alexs-mparticle
alexs-mparticle merged commit 1129498 into mParticle:main Oct 22, 2026
89 of 90 checks passed
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.

3 participants