Mediating MoPub through Google


  • Minimum required Google Mobile Ads SDK
    • iOS - 7.14.0
    • Android - 9.6.1
  • Minimum MoPub SDK - 4.10.0

Quick Guide for Mediating MoPub Using AdMob

  1. Download and add MoPub SDK and Adapters

  2. Add the Mediation Adapter in Your Project. Instructions are below

  3. Setup MoPub Mediation in the AdMob UI

Please reference the following Android iOS documentation for more detail.

Quick Guide for Mediating MoPub Using DFP

  1. Download and add the MoPub SDK Android iOS

  2. Download and add the MoPub Adapters to Your Project. Instructions below.

  3. Set up Mediation Group in DFP (Note: requires account linked to AdX ad exchange)

  4. Within the mediation group, select Ad Format and define targeting

  5. Add MoPub as a Mediation Network

  6. For integration type, choose Mobile SDK

  7. Make sure you have an AdX line item targeting the same inventory as your Mediation Group

Important setting to confirm before going live:

The Google Mobile Ads SDK is expected to control the refresh rate. The MoPub SDK refresh has to be disabled.

To disable the MoPub refresh:

  • Click the ‘Edit ad unit settings’ button on any ad unit
  • Set the refresh interval to zero.

Detailed Instructions for Integrating MoPub Adapter


Integrate Using Cocoapods

  • Add the following line to your project’s Podfile: pod 'GoogleMobileAdsMediationMoPub'.

  • Run pod install.

Integrate Manually

Add or drag the MoPubAdapter.framework into your Xcode project.

Passing extra data to MoPub

You can optionally register a GADMoPubNetworkExtras class with the ad request to set the desired size for the MoPub privacy icon in points. Values can range from 10 to 30 inclusive, with a default size of 20.

GADRequest *request = [GADRequest request];
GADMoPubNetworkExtras *extras = [[GADMoPubNetworkExtras alloc] init];
extras.privacyIconSize = 20;
[request registerAdNetworkExtras:extras];


Integrate the adapters

Add the compile dependency with the latest version of the MoPub adapter in the build.gradle file:

dependencies {
  compile '' // replace with the adapter version you wish to integrate

Passing extra data to MoPub

The MoPubAdapter.BundleBuilder class can be used to create a bundle with optional information to be passed to the MoPub adapter in an AdRequest:

Bundle bundle = new MoPubAdapter.BundleBuilder()
AdRequest adRequest = new AdRequest.Builder()
    .addNetworkExtrasBundle(MoPubAdapter.class, bundle)

Native Ads Notes

Ad Rendering

  • MoPub has 5 assets including icon, title, description, main image and CTA text.

Impressions and Click Tracking

The latest documentation and code samples for the Google Mobile Ads SDK are available at the AdMob Developer Docs.


Why am I seeing no fill resulting in blank ad slots?

We recommend working directly with DFP to resolve no fill (blank ad slot) issues. Fill rates will be impacted by your available inventory set up in the DFP dashboard. Additionally, MoPub Marketplace will not fill all impressions, if Marketplace does not have fill for an ad opportunity we will notify DFP to look to other sources such as AdX backfill.

Why is the user agent being sent up in the DFP ad request invalid?  Resulting in the DFP ad request to fail with a 400 response.

The GADBannerView may have been instantiated inside of the mopub mediator before it was configured.  To fix, remove instantiation of GADBannerView inside of mopub before we creating an instance of bannerview for a banner.

Can MoPub be mediated outside of DFP mediation/yield groups?  

Yes, MoPub can be trafficked as a line item creative, but only for banners and interstitials.  Native ad format mediation is only supported through Mediation/ Yield groups.

Can I adjust the DFP timeout threshold for MoPub mediation to be greater than 5000ms?

If using mediation/yield groups it is not possible to change the timeout threshold, the default of 5000 ms will be used.

Last updated May 18, 2020

TWITTER, MOPUB, and the Bird logo are trademarks of Twitter, Inc. or its affiliates. All third party logos and trademarks included are the property of their respective owners.

© 2020 MoPub (a division of Twitter, Inc.)