AdRequestGlobalParameters

data class AdRequestGlobalParameters(var isSHBEnabled: Boolean? = null, var dsa: AdRequestGlobalParameters.DSA? = null, var isIpIdentified: Boolean? = null, var cookiesAccess: AdRequestGlobalParameters.CookiesAccess? = null)

An object for storing global parameters that will be applied when creating an AdRequest.

Some parameters of AdRequest are designed to be passed in all requests, not just individual ones. To avoid duplicating code when creating AdRequest you can pass all parameters via AdServiceProvider.configure using the adRequestGlobalParameters parameter, and change them later using AdService.setAdRequestGlobalParameters and AdService.removeAdRequestGlobalParameter.

Note: This object describes global parameters specific only for AdRequest. However, you can also set GlobalParameters that will apply to all requests, including AdRequest via AdServiceProvider.configure using the globalParameters parameter, and change them later using AdService.setGlobalParameters and AdService.removeGlobalParameter.

// 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.setAdRequestGlobalParameters(
AdRequestGlobalParameter(
AdRequestGlobalParameters::cookiesAccess,
AdRequestGlobalParameters.CookiesAccess.NO_COOKIES
),
AdRequestGlobalParameter(
AdRequestGlobalParameters::isSHBEnabled,
true
)
)

// Clear parameter
adService.removeAdRequestGlobalParameter(AdRequestGlobalParameters::cookiesAccess)

See also

Constructors

Link copied to clipboard
constructor(isSHBEnabled: Boolean? = null, dsa: AdRequestGlobalParameters.DSA? = null, isIpIdentified: Boolean? = null, cookiesAccess: AdRequestGlobalParameters.CookiesAccess? = null)

Types

Link copied to clipboard

Enum containing all possible configurations of the server's work with cookies.

Link copied to clipboard
data class DSA(val required: DSARequirement, val pubRender: DSAPubRender, val dataToPubs: DSADataToPubs) : Parcelable

Digital Service Act (“DSA”) is a EU regulation which aims among other things to increase transparency on online platforms for users in relation to recommended content – including advertising.

Properties

Link copied to clipboard

A parameter that indicates how the ad server will work with cookies.

Link copied to clipboard

Digital Service Act (“DSA”) is a EU regulation which aims among other things to increase transparency on online platforms for users in relation to recommended content – including advertising.

Link copied to clipboard

Determines whether the IP address is anonymised.

Link copied to clipboard

Defines, if the request should also consider the server side header bidding.