Test Your Network Integration

The following guide will walk you through setting up a testing environment for testing your network integrations, and provide best practices along the way.

Setting Up A Testing Environment

Having a test ad unit setup for your integrated networks is quite important for your testing and Q&A. There are three main parts of preparing your Q&A environment:

  1. Test ads setup on desired networks.
  2. MoPub test ad units using the test ads from networks.
  3. Streamlining Testing Pipeline

Part 1: Network Test Ads Setup

There are multiple ways of doing this but a clean way is to make use of Test Ads or Test Modes issued by the networks.

  • Test Ads: Would be ads that’ll serve 100% test ads from the networks, compared to production ads which might not respond or not serve 100% time, causing you to lose time during testing. Many networks have this capability. Ex: AdMob.

  • Test Modes: Some networks have a Test Mode. You can activate it for certain devices and a time period. During that period, any requests from your designated devices would receive test ads with 100% fill from the networks. Ex: Chartboost.

For each platform / creative combination, you can create a Test Waterfall. The test waterfall would include all the network ad sources that you integrate.

  • For example, if you have these networks integrated and operational on your app:
    • ironSource: Supports test ads.
    • AdColony: Supports test ads.
    • Chartboost: Supports test mode.

Obtaining Test Ads

Networks either post this on their docs, or you can request from them. Here are some sample test ad configurations:

  • ironSource Android Interstitial
    • applicationKey: 65b1909d
    • instanceId: 0
  • AdColony Android Interstitial
    • appId: appfa7c6e22ee6742a5b3
    • zoneId: vze81f8d5dcec6405b88
  • Chartboost Android Interstitial
    • You can use your production ad information as it has a test mode which can convert those into test serving state:
    • appId: Your_Chartboost_App_Id
    • appSignature: Your_Chartboost_App_Signature
    • Note: You must add your device info into Chartboost as a testing device, and turn on Chartboost test mode. See here for details.

After gathering your test ad details for the networks you integrate, you may continue creating MoPub test ad units, explained in the next step.

Part 2: MoPub Test Ad Units Setup

This section will guide you through an example of setting up a testing environment for Android Interstitials.

After finishing this section, you can do the same for all of your platform / creative type combinations, which should be a one time setup only. Thereafter, you can follow Part 3 on how to streamline this on testing and Q&A.

Once you obtain your test ads configurations to test Android Interstitials, you can create an Android Interstitial Test Waterfall. To do that, please follow the steps below:

Step 1

Go to MoPub UI and locate your Android App:

step1

Step 2

Create a new ad unit only for Android Interstitial testing:

step2

Step 3

Configure it as a Fullscreen (Interstitial) ad and give it a self explanatory name:

step3

Step 4

When created, note down your ad unit id of your MoPub Android Interstitial testing ad unit id:

step4

In your app, change the ad unit of your Interstitial ad unit to this one for your testing build. So when you request an interstitial ad on your app, it will request from this ad unit. It’s currently empty so it won’t return any ad. Test to verify this.

// Test ad unit id is: 6a3134ded2b143f496933052e9a06072
// Your interstitial ad request code...
mInterstitial = new MoPubInterstitial(this, 6a3134ded2b143f496933052e9a06072 );
// Set listener etc.
mInterstitial.load();

Step 5

Your ad unit will be created and it will be currently empty with no ad sources configured:

step5

If there’s MoPub Marketplace setup as an ad source, you can deactivate it and reload the page.

You can now setup ad sources for each network / creative combination we want to test, such that this ad unit will have three ad sources:

  1. ironSource Android Interstitial that fills 100% with a test ad
  2. AdColony Android Interstitial that fills 100% with a test ad
  3. Chartboost Android Interstitial that fills 100% with a test ad

Step 6

Head over to Orders tab and select Create Order:

step6

Step 7

Create an Order with a self explanatory name like below example:

step7

Step 8

Hit Save. This will automatically prompt you to create a line item in this Order. You’ll begin creating 3 line items for each network mentioned. Let’s begin with ironSource. Fill out the details that you prepared earlier:

step8

After naming your line item, check the checkbox on override options and populate it with the Test Ad information for ironSource. In this case we have:

  • ironSource Android Interstitial
    • applicationKey: 65b1909d
    • instanceId: 0

Step 9

Set schedule to Start Immediately

step9

Step 10

Hit next, and on the second screen, find and select only your newly created Ad Unit. For this example it was: Android Interstitial Test Ad Unit

step10

Finish creating the line item.

Step 11

Navigate to Orders tab and find your Order. Note that it has the newly created ironSource line item in it. This is also present in the test Ad unit we created.

Hit New Line Item and create two more line items with the same steps above. You’ll create:

  • One for AdColony interstitial, which you’ll use the test ad details.
  • One for Chartboost interstitial, which you’ll use your production ad details and enable Test Mode on Chartboost for those ads.

step11

Step 12

After creating the line items, navigate to your MoPub Ad Unit. It should look like this:

step12

With now having three ad sources (line items) on same priority and present below.

Note that each line item has an Enable switch, which you can use to turn on / off. If marked off, it won’t be included in the ad request.

Step 13

Turn off the ironSource and Chartboost, such that only AdColony remains.

step13-1

When this page is refreshed, the disabled line items might not show up. It’s because of filtering. To see them back again, open out the filters dropdown.

step13-2

Then multi-select Running and Paused, which should allow you to see the disabled ones back again: step13-3

Step 14

Now if you make a request to this interstitial ad unit on your Android app, it should return an AdColony Interstitial Test ad with a 100% fill.

Below are visuals from how this test looks on the MoPub Android Sample app:

Pre Load Load Success
step14-1 step14-2

We can observe interstitial ad is loaded. We can verify that it’s an AdColony interstitial by looking at the logs:

I/MoPub: [com.mopub.mobileads.AdColonyInterstitial$2$1][run] [vze81f8d5dcec6405b88] Adapter AdColonyInterstitial successfully loaded ad

Here the vze81f8d5dcec6405b88 corresponds to the AdColony network identifier which is the zoneId that we used to setup the line item with:

  • AdColony Android Interstitial
    • appId: appfa7c6e22ee6742a5b3
    • zoneId: vze81f8d5dcec6405b88

This way, we can verify that this is the correct ad source.

When we show the interstitial ad desired test AdColony interstitial plays:

Creative Loads Begins Playing Finishes Playing End Card Shown
step14-3 step14-4 step14-5 step14-6

We can verify that our AdColony integration is correct.

Step 15

Going back to our Ad Unit on MoPub UI, now we can disable AdColony and enable Chartboost to test Chartboost:

  • Note: Don’t forget to enable Chartboost test mode.

step15

Step 16

On your device request the ad again. You should observe that now instead of AdColony, Chartboost responds:

I/MoPub: [com.mopub.mobileads.ChartboostShared$ChartboostSingletonDelegate][didCacheInterstitial] Adapter ChartboostShared successfully loaded ad

Once verified, you may move on to the next line item which is Chartboost.

Step 17

Show the ad and observe the Chartboost test creative.

  • Note: Chartboost test mode can take some time to take effect. Similarly, please note network specific guidance on test modes.

Once verified, you may move on to the next line item which is ironSource.

Step 18

Disable Chartboost and enable ironSource and re-do the test to verify ironSource ad shows up.

[com.mopub.mobileads.IronSourceInterstitial][onInterstitialAdReady] Adapter IronSourceInterstitial Log - ironSource Interstitial loaded successfully for instance 0 (current instance: 0 )

step18

  • Note: Test creatives might have different styles, but should still fill 100% by the network.

Congratulations! You verified that your setup for Android Interstitial on these networks are working as expected.

Conclusion

Now you can setup ad units for any platform / creative combination for your networks. After this one time ad unit preparation you can see the below section on how to streamline testing.

For example you can create an Android Rewarded Video test ad unit and verify it yourself. Steps for iOS are identical with Android.

Part 3: Streamlining Testing Pipeline

In order to streamline a Q&A pipeline it is worth noting if you will test directly on your development environment, or if you need to export your app to someone else for testing. So before releasing your app and when you want to Q&A MoPub network integrations:

If you will test in your development environment:

  1. Change the production ad units of your app with the test ad units you configured here.
  2. Ensure the platform / creative types match correctly.
  3. Ensure you have proper access to MoPub UI and for the test ad unit ID.
  4. Conduct tests for each platform > creative > line item network combination.
  5. Troubleshoot any issues either via logs on Android Studio Logcat or XCode logs.

If you need to export your environment for testing:

  1. Change the production ad units of your app with the test ad units you configured here.
  2. Ensure the platform / creative types match correctly.
  3. Export your project and ship it to your tester who has access and knowledge on how to Enable / Disable test line items mentioned in this guide.
  4. Tester will conduct tests for each platform > creative > line item network combination.
  5. Your tester can advise you of the results so you can troubleshoot any issues to come.

Last updated October 06, 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.)