I have MoPub banner ads working (via MoPub Marketplace) in my iOS app. I'm able to show production or test MoPub ads.
I don't understand how to use mediation to serve MoPub + Admob ads. I'm following the MoPub integration guide here https://developers.mopub.com/publishers/mediation/networks/google/
I'm using Cocoapods, so I have these 3 pods in my app:
pod 'mopub-ios-sdk'
pod 'MoPub-AdMob-Adapters', '7.64.0.1'
pod 'Google-Mobile-Ads-SDK'
I'm able to run my app and see MoPub test ads.
I'm reading MoPub's test guide, but it's not clear to me how this works. https://developers.mopub.com/publishers/ios/test/
Questions, sorry for my basic understanding of the setup:
Overall, I'm pretty confused since this is all new to me. I tried disabling my MoPub ads to test showing my test Admob ads, but it's not working. I'm using test IDs in both the Info.plist & Admob add unit ID (in Mopub). How do I make sure Admob is setup correctly and show test ads in development?
First, your Podfile has both pod 'MoPub-AdMob-Adapters'
and pod 'Google-Mobile-Ads-SDK'
, which isn't necessary because the former has the latter declared as a transitive dependency. So, you only need to add pod 'MoPub-AdMob-Adapters'
to your Podfile, and both the adapters and Google's Mobile Ads SDK will be fetched.
In the future, it's best to use the Mediation Integration Tool available at https://developers.mopub.com/publishers/mediation/integrate/ to integrate adapters. Just find the ad networks you are interested in, and hit the toggle button to get the Gradle/CocoaPods configuration to add to your app.
Now, to your questions:
When you use mediation with MoPub, you do not manually add the mediation SDKs or use their APIs. This is because MoPub handles calling the mediation APIs via the adapters, so all your need to do is integrate the adapters (what I said above), and continue using MoPub's APIs to request and serve ads (just as you would for Marketplace ads). As an example, here is the MoPub AdMob adapter for banner. You can see it handles allocating the AdMob UIView, requesting ad, and returning the ad to MoPub's SDK.
Yes, you use the AdMob ad unit IDs (not the application ID that goes into your info.plist
) in the "App and ad unit setup" tab. The same applies to other ad networks - you will use their ad unit IDs (also called placements, depending on the network) rather than their application IDs, which typically go into your app.
There is no right or wrong way to set up your waterfall. It all depends on your preference. If you just want to test that your setup with AdMob is working, I suggest creating a simple waterfall like below:
For more information on what different things mean when setting up your waterfall, check out the developer docs at https://developers.mopub.com/publishers/ui/manage-marketplace/.