MediationAdRequest | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Tools & Reference
  - Developer Stories

## Results

Loading...
public interface

# MediationAdRequest

com.google.android.gms.ads.mediation.MediationAdRequest

## Class Overview

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

## Summary

Constants
int | TAG_FOR_CHILD_DIRECTED_TREATMENT_FALSE | 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 | TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE | 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 | TAG_FOR_CHILD_DIRECTED_TREATMENT_UNSPECIFIED | 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 Methods
abstract Date | getBirthday() Returns the birthday of the user, if defined by the `AdRequest`.
abstract int | getGender() Returns the gender of the user, if defined by the `AdRequest`.
abstract Set<String> | getKeywords() Returns the set of keywords requested by the user, if defined by the `AdRequest`.
abstract boolean | isTesting() Returns true if the publisher is asking for test ads.
abstract int | taggedForChildDirectedTreatment() 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.

## Constants

#### public static final int TAG_FOR_CHILD_DIRECTED_TREATMENT_FALSE

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).

Constant Value: 0 (0x00000000)

#### public static final int TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE

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).

Constant Value: 1 (0x00000001)

#### public static final int TAG_FOR_CHILD_DIRECTED_TREATMENT_UNSPECIFIED

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).

Constant Value: -1 (0xffffffff)

## Public Methods

#### public abstract Date getBirthday ()

Returns the birthday of the user, if defined by the `AdRequest`.

#### public abstract int getGender ()

Returns the gender of the user, if defined by the `AdRequest`.

#### public abstract Set<String> getKeywords ()

Returns the set of keywords requested by the user, if defined by the `AdRequest`.

#### public abstract boolean isTesting ()

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. If no Context was provided to this class' constructor, this will always return true.

#### public abstract int taggedForChildDirectedTreatment ()

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 `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 `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 `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).