AdManagerAdRequest

public final class AdManagerAdRequest extends AdRequest


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

Summary

Nested types

Builds an AdManagerAdRequest.

Public methods

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
static final String
DEVICE_ID_EMULATOR = "B3EEABB8EE11C2BE770B684D95219ECB"

The deviceId for emulators to be used with setTestDeviceIds.

static final int

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

static final int

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

static final int

The ad string is invalid.

static final int

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

static final int

The mediation adapter did not fill the ad request.

static final int

The ad request was unsuccessful due to network connectivity.

static final int

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

static final int

The request ID in the ad string is not found.

static final int

The maximum content URL length.

Inherited methods

From com.google.android.gms.ads.AdRequest
@Nullable String

Gets the ad string.

String

Returns the content URL targeting information.

@Nullable Bundle
<T extends CustomEvent> getCustomEventExtrasBundle(Class<T> adapterClass)

This method is deprecated.

Use getNetworkExtrasBundle instead.

Set<String>

Returns targeting information keywords.

List<String>

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

@Nullable Bundle
<T extends MediationExtrasReceiver> getNetworkExtrasBundle(
    Class<T> adapterClass
)

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

String

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

boolean

Returns true if this device will receive test ads.

Public methods

getCustomTargeting

public Bundle getCustomTargeting()

Returns the custom targeting parameters.

getPublisherProvidedId

public String getPublisherProvidedId()

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