MediationAdRequest

interface MediationAdRequest

Known direct subclasses
NativeMediationAdRequest

This interface is deprecated. Use [com.google.android.gms.ads.mediation.Adapter] and [com.google.android.gms.ads.mediation.MediationNativeAdConfiguration] instead.


Information about the ad to fetch for a single publisher. The information is passed through to the ad network's adapter.

Summary

Public companion properties

Int

As returned by taggedForChildDirectedTreatment, indicates that the app should not be treated as child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA).

Int

As returned by taggedForChildDirectedTreatment, indicates that the app should be treated as child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA).

Int

As returned by taggedForChildDirectedTreatment, indicates that the publisher has not specified whether the app should be treated as child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA).

Public functions

Date?

This function is deprecated. This method is deprecated.

Int

This function is deprecated. This method is deprecated.

Set<String>?

Returns the set of keywords requested by the user, if defined by the ad request.

Location?

Returns the location of the user, if defined by the ad request.

String?

Returns the maximum ad content rating for this request.

Boolean

This function is deprecated. This method is deprecated.

Boolean

Returns true if the publisher is asking for test ads.

Int

Returns whether the publisher indicated that the app is to be treated as child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA) - http://business.ftc.gov/privacy-and-security/childrens-privacy.

Int

Returns whether the publisher indicated that the ad request should receive treatment for users in the European Economic Area (EEA) under the age of consent, if defined by the ad request.

Public companion properties

TAG_FOR_CHILD_DIRECTED_TREATMENT_FALSE

val TAG_FOR_CHILD_DIRECTED_TREATMENT_FALSEInt

As returned by taggedForChildDirectedTreatment, indicates that the app should not be treated as child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA).

TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE

val TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUEInt

As returned by taggedForChildDirectedTreatment, indicates that the app should be treated as child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA).

TAG_FOR_CHILD_DIRECTED_TREATMENT_UNSPECIFIED

val TAG_FOR_CHILD_DIRECTED_TREATMENT_UNSPECIFIEDInt

As returned by taggedForChildDirectedTreatment, indicates that the publisher has not specified whether the app should be treated as child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA).

Public functions

getBirthday

fun getBirthday(): Date?

Returns the birthday of the user, if defined by the ad request.

getGender

fun getGender(): Int

Returns the gender of the user, if defined by the ad request.

getKeywords

fun getKeywords(): Set<String>?

Returns the set of keywords requested by the user, if defined by the ad request.

getLocation

fun getLocation(): Location?

Returns the location of the user, if defined by the ad request.

getMaxAdContentRating

fun getMaxAdContentRating(): String?

Returns the maximum ad content rating for this request. This content rating is the more conservative rating between the publisher-specified rating in the ad request, or the app rating provided by Google's ad server.

isDesignedForFamilies

fun isDesignedForFamilies(): Boolean

Publishers that have opted into the Designed for Families program may specify that an ad request should return a Designed for Families-compliant ad. Please see the Google AdMob help center article for more information about this setting.

Returns true if the publisher indicated that the ad request is required to return a Designed for Families-compliant ad.

Returns false if the publisher did not indicate that the ad request is required to return a Designed for Families-compliant ad.

Note: This setting is separate from the Children's Online Privacy Protection Act (COPPA) "tag for child directed treatment" setting. For COPPA-related compliance, see taggedForChildDirectedTreatment.

isTesting

fun isTesting(): Boolean

Returns true if the publisher is asking for test ads. Publishers request test ads by specifying a device ID, but this information is resolved to a boolean for convenience.

taggedForChildDirectedTreatment

fun taggedForChildDirectedTreatment(): Int

Returns whether the publisher indicated that the app is to be treated as child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA) - http://business.ftc.gov/privacy-and-security/childrens-privacy.

If this method returns MediationAdapter.TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE, it indicates that the app should be treated as child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA).

If this method returns MediationAdapter.TAG_FOR_CHILD_DIRECTED_TREATMENT_FALSE, it indicates that the app should not be treated as child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA).

If this method returns MediationAdapter.TAG_FOR_CHILD_DIRECTED_TREATMENT_UNSPECIFIED, it indicates that the publisher has not specified whether the app should be treated as child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA).

taggedForUnderAgeTreatment

fun taggedForUnderAgeTreatment(): Int

Returns whether the publisher indicated that the ad request should receive treatment for users in the European Economic Area (EEA) under the age of consent, if defined by the ad request. This feature is designed to help facilitate compliance with the General Data Protection Regulation (GDPR).