GlobalParameters

data class GlobalParameters(var gdpr: GDPR? = null, var externalUID: ExternalUID? = null, var isOptOutEnabled: Boolean? = null, var accessMode: AccessMode? = null, var userIds: List<UserIdType>? = null)

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 adRequestGlobalParameters parameter, 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

Link copied to clipboard
constructor(gdpr: GDPR? = null, externalUID: ExternalUID? = null, isOptOutEnabled: Boolean? = null, accessMode: AccessMode? = null, userIds: List<UserIdType>? = null)

Properties

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard
var gdpr: GDPR?

App can ask users about their consent for sharing information with third parties.

Link copied to clipboard

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.

Link copied to clipboard

List of identifiers for additional extended IDs on the Identity Service. The data type of userIds is a list of UserIdType.