Global Parameters
An object for storing common global parameters that will be applied when creating an AdRequest, TagRequest, and TrackingRequest.
Some parameters of TagRequest, TrackingRequest and AdRequest are designed to be passed in all requests, not just individual ones. To avoid duplicating code when creating requests you can pass all parameters via AdServiceProvider.configure using the globalParameters parameter, and change them later using AdService.setGlobalParameters and AdService.removeGlobalParameter.
Note: This object describes common global parameters for AdRequest, TrackingRequest, and TagRequest. At the same time, AdRequest has some unique parameters – AdRequestGlobalParameters. You can also set them separately via AdServiceProvider.configure using the
adRequestGlobalParametersparameter, and change them later using AdService.setAdRequestGlobalParameters and AdService.removeAdRequestGlobalParameter.
// Set parameter
val result = adServiceProvider.configure(
networkId = NETWORK_ID,
parentCoroutineScope = coroutineScope,
globalParameters = GlobalParameters(accessMode = AccessMode.OPT_OUT),
adRequestGlobalParameters = AdRequestGlobalParameters(isIpIdentified = false)
)
// Change parameter over time
adService.setGlobalParameters(
GlobalParameter(
GlobalParameters::externalUID,
ExternalUID(externalId, true)
)
GlobalParameter(
GlobalParameters::userIds,
listOf(UserIdType.Idfa("AAAA"), UserIdType.Netid("BBBB"))
)
)
// Clear parameter
adService.removeGlobalParameter(GlobalParameter::externalUID)See also
Constructors
Properties
An ad server automatically processes data on an opt-out basis, but if it has the right to collect user data, it can instead be configured to use an opt-in approach.
If your app has means to identify a user, for example through association with an user account or an advertising ID, you can share this with the ad server.
An app can ask users if they want to opt out from process data. Use isOptOutEnabled to make the users choice visible for the ad server.
List of identifiers for additional extended IDs on the Identity Service. The data type of userIds is a list of UserIdType.