This guide shows you how to integrate a mediation adapter with your current iOS app and set up additional request parameters.
Prerequisites
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.
Choosing your mediation networks
Ad Manager mediation supports several ad sources, with a mix of waterfall and Open Bidding integrations. Select an ad source below for integration instructions specific to that ad source.
Ad Source | Banner | Interstitial | Rewarded | Native | Automatic data collection support |
|
---|---|---|---|---|---|---|
Open source and versioned - 3rd party SDKs required | ||||||
AdColony | Country-specific | |||||
AppLovin | Country-specific | |||||
Chartboost | Country-specific | |||||
Country-specific | ||||||
Fyber Marketplace | Country-specific | |||||
i-mobile | Country-specific | |||||
InMobi | Country-specific | |||||
ironSource | Country-specific | |||||
maio | Global | |||||
MoPub | Country-specific | |||||
myTarget | Country-specific | |||||
nend | Global | |||||
Tapjoy | Country-specific | |||||
Unity Ads | Country-specific | |||||
Verizon Media | Country-specific | |||||
Vungle | Country-specific | |||||
Non-open source - 3rd party SDKs required | ||||||
AdFalcon | Country-specific | |||||
Flurry | Country-specific | |||||
Leadbolt | Country-specific | |||||
LG U+AD | None | |||||
Tencent GDT | None | |||||
Vpon | None | |||||
Zucks | Country-specific |
Open source and versioned adapters
If an adapter is labeled with "Open source and versioned" in the above table, it means the adapter source code is open-sourced in Google's GitHub repository, enabling you to debug issues yourself should you choose to do so.
It also means that there are versioned adapter builds in Google's bintray repository, built against a specific version of the third-party ad network SDK. You can also integrate these adapters into your app with a single line change to your app's Podfile. Click on a specific ad network's guide for more details.
Adapter versioning
The adapter versioning scheme for versioned adapters is <third-party
SDK version>.<adapter patch version>
. For example, if an
ad network releases a new SDK version 1.2.3
, a new adapter version 1.2.3.0
will be released to Bintray after being tested against that new SDK.
If an adapter needs updating outside the lifecycle of a third-party SDK release,
the patch version will increase. A bug fix for adapter version 1.2.3.0
will
be released in version 1.2.3.1
.
Automatic data collection support
When you configure multiple ad networks for mediation, you have to specify what order to request these networks by setting their respective CPM. This can be difficult to manage, since ad network performance changes over time.
Automatic data collection is a feature that enables you to generate the highest CPM from the ad networks in your mediation chain by automating the process of ordering the mediation chain to maximize revenue.The mediation networks table above uses the following values for Automatic data collection support:
Automatic data collection support | What it means |
---|---|
Country-specific |
eCPM values are automatically updated on your behalf on a per-country basis. This is the optimal type of optimization. |
Global |
A single global eCPM value is automatically updated on your behalf. |
None |
You must manually configure an eCPM value for that ad network. |
Click on a specific ad network's guide for details on how to configure Automatic data collection for that network.
Custom events
If you're looking for an ad network and don't see it on the list above, you can use custom events to write your own integration with that ad network. See Custom Events for more details on how to create a custom event.
Check the value of adNetworkClassName
Each ad format class has an adNetworkClassName
property on the
GADResponseInfo
object that returns the class name of the ad network that
fetched the current ad. This property only has a value once an ad successfully
loads.
Here is some sample code that logs the ad network class name for each ad format.
Banner
Swift
func adViewDidReceiveAd(_ bannerView: DFPBannerView) { print("Banner adapter class name: \(bannerView.responseInfo.adNetworkClassName)") }
Objective-C
- (void)adViewDidReceiveAd:(DFPBannerView *)bannerView { NSLog(@"Banner adapter class name: %@", bannerView.responseInfo.adNetworkClassName); }
Interstitial
Swift
func interstitialDidReceiveAd(_ interstitial: DFPInterstitial) { print("Interstitial adapter class name: \(interstitial.responseInfo.adNetworkClassName)") }
Objective-C
- (void)interstitialDidReceiveAd:(DFPInterstitial *)interstitial { NSLog(@"Interstitial adapter class name: %@", interstitial.responseInfo.adNetworkClassName); }
Native
Swift
func adLoader(_ adLoader: GADAdLoader, didReceive nativeAd: GADUnifiedNativeAd) { print("Native adapter class name: \(nativeAd.responseInfo.adNetworkClassName)") }
Objective-C
- (void)adLoader:(GADAdLoader *)adLoader didReceiveUnifiedNativeAd:(GADUnifiedNativeAd *)nativeAd { NSLog(@"Native adapter class name: %@", nativeAd.responseInfo.adNetworkClassName); }
Refer to Retrieving Information about the Ad Response for details.
Banner ads mediation
Make sure to disable refresh in all third-party ad networks UI for banner ad units used in Ad Manager mediation. This will prevent a double refresh since Ad Manager also triggers a refresh based on your banner ad unit's refresh rate.
Rewarded ads mediation
We recommend that you override all default reward values by setting reward values in the Ad Manager UI. To do this, select the Override reward settings from third-party ad networks when using mediation box so that the reward is consistent across all networks. Some ad networks don't provide a reward value or type at all. By overriding the reward value, the reward is consistent no matter which ad network served the ad.

Refer to set up and traffic rewarded ads for apps for more information.
Native ads 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.