Skip to content

feat: pass mParticle session ID to Rokt SDK on launcher creation#74

Open
crisryantan wants to merge 1 commit intomparticle-integrations:mainfrom
crisryantan:feature/pass-mp-session-id-to-rokt-sdk
Open

feat: pass mParticle session ID to Rokt SDK on launcher creation#74
crisryantan wants to merge 1 commit intomparticle-integrations:mainfrom
crisryantan:feature/pass-mp-session-id-to-rokt-sdk

Conversation

@crisryantan
Copy link
Contributor

Summary

  • Reads the current mParticle session ID from window.mParticle.sessionManager.getSession() in attachLauncher() and passes it as options.mpSessionId to Rokt.createLauncher
  • This enables the Rokt Web SDK to associate dual-send events with the originating mParticle session, allowing cross-system correlation in the transactions data lake

Changes

  • src/Rokt-Kit.js: In attachLauncher(), safely read the mParticle session ID (with null checks for sessionManager availability) and include it in the options object passed to both createLauncher and createLocalLauncher
  • test/src/tests.js: Added sessionManager mock to mParticle stubs, updated MockRoktForwarder to capture mpSessionId, and added test cases verifying the session ID is passed when available and omitted when sessionManager is unavailable

Companion PR

  • This works alongside a companion PR on ROKT/sdk-web that receives mpSessionId through the launcher options, stores it in PartnerConfigurationService, auto-refreshes it via __event_stream__ events, and includes it in the v2/sessions/events request body

Test Plan

  • Unit tests pass for mpSessionId presence when sessionManager is available
  • Unit tests pass for mpSessionId absence when sessionManager is unavailable
  • Integration testing with Rokt Web SDK consuming the new option

Made with Cursor

Read the current mParticle session ID from sessionManager.getSession()
in attachLauncher() and include it as mpSessionId in the options object
passed to Rokt.createLauncher. This enables the Rokt SDK to associate
dual-send events with the originating mParticle session.

Made-with: Cursor
@crisryantan crisryantan marked this pull request as ready for review March 24, 2026 04:54
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.

1 participant