Search code examples
androidadmobadsleadbolt

Testing 3rd party network ads in AdMob


I have setup AdMob ads in my app and tested if they work. Now I also have added the Leadbolt network to the same Ad unit in AdMob but I am not getting Leadbolt ads to show up and am wondering if I'm doing something wrong or this is not even possible to test when I build test requests fro AdMob. This is how I request a test add.

AdRequest adRequest = new AdRequest.Builder()
         .addTestDevice("XXXXXXXXX")
         .build();

Now I have done everything the Leadbolt setup tells me.

  • I included Leadbolt on the add for my app on AdMob with my correct API key and [ inapp ] as location code.
  • I have setup a high floor eCPM at $20.00, I also tried with $0,01.
  • I still am requesting ads from AdMob for a testing device: new AdRequest.Builder().addTestDevice("XXXX").build(); But I have tried a couple of times without testing.
  • this with Gradle for my android module.
  • I have added the activity to AndroidManifest.xml

    <activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:name="com.apptracker.android.module.AppModuleActivity" android:hardwareAccelerated="false"> </activity>

  • I have also set the permissions:

<uses-permission android:name="android.permission.INTERNET" />

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Have I missed anything? If not then how can I test ads from a 3th party network when I am not allowed to request real ads in a development state?


Solution

  • Mediation can be a rough spot for testing. The way the AdMob testing architecture works involves swapping your production ad unit ID for a test ad unit ID, which means your mediation configuration is not used.

    You can work around this by doing these steps:

    1. Make sure your app is in LeadBolt's test mode.
    2. Temporarily change your ad unit mediation configuration so that LeadBolt has a ridiculously high eCPM ($100, say) and AdMob has a ridiculously low one ($0.01). Optionally, use country code restrictions to limit AdMob to only serving in Antarctica.
    3. Remove addTestDevices from your request building logic.
    4. Run your app.
    5. Make sure you see LeadBolt's test ads.
    6. Undo steps #1, #2, and #3.

    The big thing for AdMob is that you don't view AdMob's production ads while testing, and you definitely don't click through AdMob's production ads while testing. These steps should avoid both.