B Bubbl Docs

Segments and Correlation IDs

Segments and correlation IDs help you connect Bubbl campaigns to your app's own user or session context.

Segments

Segments are tags that describe the user's current eligibility. Bubbl can use them to decide which campaigns should be available to the device.

Set initial segments when booting:

BubblConfig(
    apiKey = "<YOUR_BUBBL_API_KEY>",
    segments = listOf("member", "london")
)

Update them later when user state changes:

BubblSdk.updateSegments(listOf("member", "premium"))

Flutter:

await BubblSdk.instance.updateSegments(['member', 'premium']);

React Native:

await Bubbl.updateSegments(['member', 'premium']);

Correlation IDs

A correlation ID lets you connect Bubbl SDK activity with a user, session, install, or journey ID in your own system.

Set one at boot:

BubblConfig(
    apiKey = "<YOUR_BUBBL_API_KEY>",
    correlationId = "user-or-session-id"
)

Update or clear it later:

BubblSdk.setCorrelationId("new-session-id")
BubblSdk.clearCorrelationId()

Do not put sensitive personal data directly in a correlation ID. Use a stable internal identifier or pseudonymous ID where possible.