Google Mobile Ads Mediation Adapter v1.3.0

Millennial Media provides a Google Mobile Ads mediation adapter for developers using AdMob. For other mediation solutions please contact the mediator directly.

Please note that the adapter is only compatible with Millennial SDK version 6.3.0 and higher.

Click here to download the Google Mobile Ads mediation adapter.

Adapter Integration Guide

This integration guide assumes that you have already integrated the Google Mobile Ads SDK into your app project. You will need a placement ID and site ID from One by AOL (Nexage) and an ad unit ID from AdMob.

Note on Selectively Compiling Google Play Services

If you are selectively compiling Google Play Services APIs with your app, you MUST include the base component as the MM SDK is dependent on it. To include the base APIs, add the following to your application’s build.gradle:

Again, this is only required if you are NOT including the entire Google Play Services API (i.e.

1. Integrate the MillennialMedia library with your project.

Follow the instruction steps in our SDK integration guide. You may include location information, though this will be provided through the Google Ads connector and not directly through the Millennial SDK.

2. Add the mediation adapter to your project.

Add the Android Google Ads MM Adapter .aar file (above) into the libs directory in your project. To reference .aar files in your libs folder you must add the flatDir object to your project’s build.gradle file:

allprojects {
    repositories {
        flatDir {
            dirs 'libs'

You can then reference the .aar in the application’s build.gradle file as shown below:

compile(name:'android-google-ad-mm-adapter-1.3.0-c8332522', ext:'aar')

3. Add your Site ID

In order to pass your Site ID to the Millennial Media SDK, an added piece of code is required:

Bundle siteId = new Bundle();
siteId.putString("dcn", "<YOUR_SITE_ID>"); // Replace with a SiteID/DCN
AdRequest request = new AdRequest.Builder()
        .addNetworkExtrasBundle(NexageAdapter.class, siteId)

4. Add One by AOL (Nexage) as an ad source on AdMob

You should add One by AOL (Nexage) as a supported mediation ad source for each placement. AdMob will provide you with ad unit IDs for each banner or interstitial placement, which are now ready to request and display Millennial ads based on your mediation settings.

Note on using Google Ads without passing in an Activity

In the rare case that you are instantiating the Google Ads AdView or InterstitialAd class with a Context that is NOT an Activity, you must call the MMSDK.initialize method explicitly. In this instance, it is highly recommended that you extend the Application class and initialize the MM SDK during the onCreate phase of the Application. The MM SDK initialization code is shown here:

try {
   MMSDK.initialize(this); // pass in current Application instance
} catch (MMException e) {
   // handle initialization failure here

Again, this initialization is only required if you instantiate Google Ads with a Context that is NOT an Activity.

Supported Metadata

The Millennial SDK supports the following metadata that can be sent through the Google Ads connector:

  • Age
  • Gender
  • Keywords
  • Location
  • COPPA (i.e tagForChildDirectedTreatment)

See the AdMob documentation for more details.