Skip to main content
Version: SDK 6.0.x

Get an advertiser and test group ID

The justtrack SDK can provide the advertiser ID of the user if the user didn't limit ad tracking. Additionally, users are assigned to one of three test groups (1, 2, or 3) based on their advertiser ID. You can retrieve the test group ID from the SDK, implement different logic for a specific group, and compare that group’s performance in the justtrack dashboard.

sdk.getAdvertiserIdInfo().observe { result in
switch result {
case let .success(info):
let advertiserId: String? = info.advertiserId
let isLimitedAdTracking = info.limitedAdTracking
log("My advertiser ID is \(advertiserId)")
log("Ad tracking is limited = \(isLimitedAdTracking)")
let testGroupId: Int? = sdk.testGroupId
log("My test group ID is \(testGroupId)")
case let .failure(error):
log("error: \(error.localizedDescription)")
}
}