Get started

This guide shows you how to integrate a mediation adapter with your iOS app.


Before you can integrate mediation for an ad format, you need to integrate that ad format into your app:

New to mediation? Read Introduction to mediation.

For bidding: Google Mobile Ads SDK 7.53.1 or higher.

Initialize the Mobile Ads SDK

The quick start guide shows you how to initialize the Mobile Ads SDK. During that initialization call, mediation adapters also get initialized. It is important to wait for initialization to complete before you load ads in order to ensure full participation from every ad network on the first ad request.

The following sample code shows how you can check each adapter's initialization status prior to making an ad request.


import GoogleMobileAds

class AppDelegate: UIResponder, UIApplicationDelegate {

  func application(_ application: UIApplication,
      didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

    let ads = GADMobileAds.sharedInstance()
    ads.start { status in
      // Optional: Log each adapter's initialization latency.
      let adapterStatuses = status.adapterStatusesByClassName
      for adapter in adapterStatuses {
        let adapterStatus = adapter.value
        NSLog("Adapter Name: %@, Description: %@, Latency: %f", adapter.key,
        adapterStatus.description, adapterStatus.latency)

      // Start loading ads here...

    return true



@import GoogleMobileAds;

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

  GADMobileAds *ads = [GADMobileAds sharedInstance];
  [ads startWithCompletionHandler:^(GADInitializationStatus *status) {
    // Optional: Log each adapter's initialization latency.
    NSDictionary *adapterStatuses = [status adapterStatusesByClassName];
    for (NSString *adapter in adapterStatuses) {
      GADAdapterStatus *adapterStatus = adapterStatuses[adapter];
      NSLog(@"Adapter Name: %@, Description: %@, Latency: %f", adapter,
            adapterStatus.description, adapterStatus.latency);

    // Start loading ads here...
  return YES;


Know which ad network wins

Each ad format class has a GADResponseInfo property that contains adNetworkClassName which returns the class name of the ad network for the current ad. adNetworkClassName only has a value once an ad successfully loads. The following code shows you how to get that information for banner ads.


func adViewDidReceiveAd(_ bannerView: GAMBannerView) {
  print("Banner adapter class name: \(bannerView.responseInfo.adNetworkClassName)")


- (void)adViewDidReceiveAd:(GAMBannerView *)bannerView {
  NSLog(@"Banner adapter class name: %@", bannerView.responseInfo.adNetworkClassName);

Refer to Retrieving Information about the Ad Response for details.

Use banner ads with mediation

Make sure to disable refresh in all third-party ad source UIs for banner ad units used in mediation. This prevents a double refresh since Ad Manager also triggers a refresh based on your banner ad unit's refresh rate.

Use native ads with mediation

The following are some best practices to consider when implementing native mediation.

Native ad presentation policy
Each ad network has its own policies. When using mediation, it's important to remember that your app still needs to abide by the policies of the mediated network that provided the ad.
Avoid using the GADMultipleAdsAdLoaderOptions class when making requests
Requests for multiple native ads only serve Google ads. The multiple native ads feature does not support mediation.

US states privacy laws and GDPR

If you need to comply with the U.S. states privacy laws or General Data Protection Regulation (GDPR), follow the steps in US state regulations settings or GDPR settings to add your mediation partners in Ad Manager Privacy & messaging's US states or GDPR ad partners list. Failure to do so can lead to partners failing to serve ads on your app.

Learn more about enabling restricted data processing (RDP) and obtaining GDPR consent with the Google User Messaging Platform (UMP) SDK.