AdManagerAdRequest

class AdManagerAdRequest : AdRequest


An AdManagerAdRequest contains targeting information used to fetch an ad from Google Ad Manager. Ad requests are created using AdManagerAdRequest.Builder.

Summary

Public functions

Bundle!

Returns the custom targeting parameters.

String!

Returns the identifier used for frequency capping, audience segmentation and targeting, sequential ad rotation, and other audience-based ad delivery controls across devices.

Inherited Constants

From com.google.android.gms.ads.AdRequest
const String!
DEVICE_ID_EMULATOR = "B3EEABB8EE11C2BE770B684D95219ECB"

The deviceId for emulators to be used with setTestDeviceIds.

const Int

The ad request was not made due to a missing app ID.

const Int

Something happened internally; for instance, an invalid response was received from the ad server.

const Int

The ad string is invalid.

const Int

The ad request was invalid; for instance, the ad unit ID was incorrect.

const Int

The mediation adapter did not fill the ad request.

const Int

The ad request was unsuccessful due to network connectivity.

const Int

The ad request was successful, but no ad was returned due to lack of ad inventory.

const Int

The request ID in the ad string is not found.

const Int

The maximum content URL length.

Inherited functions

From com.google.android.gms.ads.AdRequest
String?

Gets the ad string.

String!

Returns the content URL targeting information.

Bundle?
<T : CustomEvent?> getCustomEventExtrasBundle(adapterClass: Class<T!>!)

This function is deprecated.

Use getNetworkExtrasBundle instead.

(Mutable)Set<String!>!

Returns targeting information keywords.

(Mutable)List<String!>!

Returns the list of neighboring content URLs or an empty list if no URLs were set.

Bundle?
<T : MediationExtrasReceiver?> getNetworkExtrasBundle(
    adapterClass: Class<T!>!
)

Returns extra parameters to pass to a specific ad network adapter.

String!

Returns the request agent string to identify ad request's origin.

Boolean
isTestDevice(context: Context!)

Returns true if this device will receive test ads.

Public functions

getCustomTargeting

fun getCustomTargeting(): Bundle!

Returns the custom targeting parameters.

getPublisherProvidedId

fun getPublisherProvidedId(): String!

Returns the identifier used for frequency capping, audience segmentation and targeting, sequential ad rotation, and other audience-based ad delivery controls across devices.