Mediate from MoPub

The following instructions apply to publishers looking to mediate their MoPub inventory to ONE by AOL: Mobile.

Integrating with the ONE by AOL: Mobile SDK may require a "Custom Network" within MoPub using the adapters listed below.

Notice to Unity Engine developers: The AOL Mobile SDK can still deliver ads on an app developed through the Unity Engine if you are mediating through MoPub. Please follow the instructions that correspond to the MillennialSupport.unitypackage integration found on MoPub's documentation page to get started. 

Add the MoPub Adapter

Download the Current Adapters: We have released updated MoPub adapter files via pull request to the MoPub git repository. 


  MoPub SDK v4.10.0
MM Ad SDK v6.3.1 MoPub Upstream Adapter



  MoPub SDK v4.10.0
MM Ad SDK v6.3.1 MoPub Upstream Adapter

For Android, copy the ONE by AOL: Mobile adapter files into the directory within the project's root. i.e., mopub-sdk/src/main/java/com/mopub/mobileads/ (banner / interstitial) or mopub-sdk/src/main/java/com/mopub/nativeads/ (native).

For iOS, drag the ONE by AOL: Mobile adapter files into Xcode within the MoPub SDK directory. In the window that follows, copy items to the destination and add them to your project's main targets.

Rewarded Video

Our rewarded video adapters are still under review by the MoPub team and aren't posted at the official download repository yet.

They must be downloaded separately: Android (link to file) / iOS (you'll also need MPMillennialRewardedVideoCustomEvent.h and MPMillennialRewardedVideoCustomEvent.m).

They have been tested thoroughly by the Millennial engineering team. Reach out to your account manager if there are any questions or concerns.

Configure MoPub to use ONE by AOL: Mobile

MoPub, by default, allows only a single parameter in its—ad unit ID (formerly Millennial Media Network’s Placement ID either APID, spot alias, or position). Using MoPub with ONE by AOL: Mobile (formerly Nexage), however, requires adding Exchange compatibility to the SDK integration. Network set up in MoPub is similar to previous SDK versions. Publishers will integrate MoPub with Ad Network Support, and use the dashboard to enter their placement ID.

Choose the Networks tab at the top of the webpage.

  1. Click the Add a Network button. If you formerly had a Nexage integration, skip this.
  2. Click the Custom Native Network link. This gives the SDK the power to invoke adapter classes and pass them data.
  3. Name the network and use the Edit Network screen to enter the Custom Network Information. Be sure to fill in all the required fields as they are integral to making mediation work within the app.

Each of the Ad Units targeted by this custom network will require some additional information (Custom Event Class and Custom Event Class Data) which varies between iOS and Android.  See the second and third columns of the table below; it represents what will be shown on the following screen. (The first column is deprecated by MoPub and shouldn't be used.) 

Type Custom Event Class Custom Event Data
iOS Banner MPMillennialBannerCustomEvent {"adUnitID":"<placement ID>", "dcn":"<dcn here>", "adWidth":<width here>, "adHeight":<height here>}
iOS Interstitial MPMillennialInterstitialCustomEvent {"adUnitID":"<placement ID>", "dcn":"<dcn here>"}
iOS Rewarded MPMillennialRewardedVideoCustomEvent {"adUnitID":"<placement ID>", "dcn":"<dcn here>"}
iOS Native MillennialNativeCustomEvent {"adUnitID":"<placement ID>", "dcn":"<dcn here>"}
Android Banner com.mopub.mobileads.MillennialBanner {"adUnitID":"<placement ID>", "dcn":"<dcn here>", "adWidth":<width here>, "adHeight":<height here>}
Android Interstitial com.mopub.mobileads.MillennialInterstitial {"adUnitID":"<placement ID>", "dcn":"<dcn here>"}
Android Rewarded com.mopub.mobileads.MillennialRewardedVideo {"adUnitID":"<placement ID>", "dcn":"<dcn here>"}
Android Native com.mopub.nativeads.MillennialNative {"adUnitID":"<placement ID>", "dcn":"<dcn here>"}

Each JSON (JavaScript Object Notation) string in the third column represents the data (key-value pairs) that are passed into the adapter. For banners, there are four keys required:

  • adUnitID (the same as before): Representing the ad placement within the app
  • dcn (Distribution Channel Number): a site ID representing the app
  • adHeight (banners only): The height of a banner in device-independent pixels (typical values: 50, 90, or 250)
  • adWidth (banners only): The width of a banner in device-independent pixels (typical values: 320, 728, or 300)

Popular, well supported values for width and height are 320x50, 480x60, 300x250 (rectangle), and 728x90 (leaderboard).

An interstitial tag should only have adUnitID and dcn.
Example: {"adUnitID":"inter","dcn":"8a809417014e4ed57dceda3a2f1e0050"}

A Word on Native

OS-Native adapters for native ads must always be handled through a custom network. Even though it is possible to set the UI to point to Millennial Media, the connection will NOT invoke the adapters correctly.

Set Pricing

New placements first appear with a zero-value and therefore the custom network won't serve to the app. Go back to the Networks screen (click the large Networks button at the top), then the blue link for the new network. Select Segments and Line Items, then choose the segment you wish to target with this custom network (or Global). Turn off the default filters to edit the values.

Now, add the expected eCPM for this ad unit and it will begin delivering.


Have more questions? Submit a request