Use setIdsAndDomain(...) to switch the configured track IDs and track domain during the current app session.
Important
Switching accounts at runtime changes where subsequent tracking requests are sent. It is best suited for rare, explicit transitions such as switching between app variants, markets, or account-specific contexts.
Method
Method | Description |
|---|---|
| Updates the active track IDs and track domain for the current runtime session. |
| Returns the currently active runtime values. |
Kotlin example
Webtrekk.getInstance().setIdsAndDomain(
trackIds = listOf("1111111111111111", "2222222222222222"),
trackDomain = "yourtrackdomain.mapp.com"
)Persisting the change
setIdsAndDomain(...) changes the active configuration only for the current runtime session. If you want the same values after the app restarts, initialize the SDK with the same track IDs and domain in your main configuration.
val configuration = WebtrekkConfiguration.Builder(trackIds, trackDomain)
.build()When to use it
You need to switch between different Intelligence accounts while the app is running.
You explicitly route tracking to different accounts for different app contexts.
When not to use it
Do not call this method as part of normal page-to-page navigation.
Do not use it as a substitute for the normal SDK initialization flow when your app only has one stable account configuration.
Related pages: Initialize the SDK, Configure Global Tracking, Retrieve Active Global Configuration.