Test Your MoPub SDK Integration

Before you publish your app with MoPub and mediated networks, we strongly recommend that you test your MoPub integrations to ensure they are operating properly.

Integration Review

  1. Review our Supported Networks Page to ensure you are using the certified network SDK versions and that the ad unit format you are testing is supported.

  2. Enable the ad network on an ad unit.

  3. Make sure that you have entered your ad networks properly. This includes entering network IDs and custom event class data correctly where applicable.

How to Test

Begin by testing your MoPub Marketplace integration. Once you know it is successful, proceed to test your ad network integrations. Reading device logs can help you troubleshoot your integration.

Step 1. Test Your MoPub Integration

You can test your integration with MoPub Marketplace by using either a guaranteed line item or MoPub test ad units.

Option 1. Test Using a Guaranteed Line Item

  1. Create a guaranteed (or self-serve) line item for testing purposes. Refer to these instructions on how to create a line item if needed.

  2. Add the test creative to your line item.

  3. Follow the instructions to test ad network integrations on this page to test your line item. You can confirm it has been done correctly if you see the test creative associated with your line item.

Option 2. Test Using MoPub Test Ad Units

Select the ad unit ID for the format you wish to test and use that ad unit in your application code.

IMPORTANT: After testing, be sure to replace the MoPub test ad units with the production ad unit IDs from your own MoPub account.

Format Size Ad unit ID
Banner 320x50 b195f8dd8ded45fe847ad89ed1d016da
Banner (MRect) 300x250 252412d5e9364a05ab77d9396346d73d
Interstitial 320x480 24534e1901884e398f1253216226017e
Rewarded Video N/A 920b6145fb1546cf8b5cf2ac34638bb7
Rewarded Video (MRAID) 320x480 15173ac6d3e54c9389b9a5ddca69b34b
Rewarded Playable N/A 15173ac6d3e54c9389b9a5ddca69b34b
Native N/A 11a17b188668469fb0412708c3d16813

Step 2. Test Your Ad Network Integrations

Test each network separately to ensure that each network in your waterfall is integrated correctly. Refer to “Waterfall Latency and Best Practices” for specifics on network timeout thresholds.

  1. Make sure that the ad network or line item you are testing is active. Active networks and line items display a green circle in your ad source breakdown on the ad unit page. When paused, line items read ‘Paused’ in the Status column.

  2. Pause all other ad networks and line items targeted to your ad unit in the MoPub UI.

  3. Begin testing on the device. Make sure you can see the device logs while you are testing, because you will review them to troubleshoot any problems you encounter.

Using Device Logs

Testing Impression and Click Trackers

Make sure that ad requests, impressions, and clicks are firing correctly in your app. In addition to observing what happens on screen when you show and click on an ad, check the device logs for the following messages. You can monitor device logs in Android Studio documentation.

How to Interpret Device Logs

Make sure that ad requests, impressions, and clicks are firing correctly in your app. In addition to observing what happens on screen when you show and click on an ad, check the device logs for the following messages. You can check for device logs via adb logcat or Android Studio’s built-in console log.

Enable Logging

Starting in v5.5.0 of the MoPub SDK, SDK-level logging is disabled by default. To enable logging, you must explicitly set the log level to either INFO or DEBUG when initializing the MoPub SDK. In comparison, the DEBUG option is the more verbose among the two log levels.

final SdkConfiguration.Builder configBuilder = new SdkConfiguration.Builder("YOUR_AD_UNIT_ID");

   if (BuildConfig.DEBUG) {
      configBuilder.withLogLevel(DEBUG);
   } else {
      configBuilder.withLogLevel(INFO);
   }

MoPub.initializeSdk(this, configBuilder.build(), initSdkListener());

To disable logging, e.g. when your app is in production, set the log level to NONE.

What Log Messages Mean

Starting with the 5.5.0 release of the MoPub SDK, all log messages are preceded with the complete paths to the methods where the MoPub logger is invoked. This makes it easier to trace each log entry to the exact class and method in order to help you debug issues more quickly. As a result, log entries are now more consistent, and they include additional information like the ad format, ad source, MoPub-related tags, SDK/adapter/ad lifecycle events, and versions of mediated SDKs and adapters.

The following log messages are chronologically organized based on the lifecycle of the ad:

Description Pre-5.5.0 SDK Post-5.5.0 SDK
The MoPub SDK initialization has begun as a result of calling MoPub.initializeSdk(). Do not make ad requests yet. N/A [com.mopub.common.MoPub][initializeSdk] SDK initialization started
The MoPub SDK has finished initializing and the onInitializationFinished callback will be dispatched immediately. It is safe to make ad requests at this time. N/A [com.mopub.common.MoPub$InternalSdkInitializationListener][onInitializationFinished] SDK initialized and ready to display ads.
The MoPub SDK is about to make an ad request to the ad server. N/A [com.mopub.mobileads.MoPubView][loadAd] Ad attempting to load
An ad request has been made to the MoPub ad server. Loading url: http://ads.mopub.com/m/ad?… [com.mopub.mobileads.AdViewController][loadNonJavascript] SDK Log - Loading url: https://ads.mopub.com/m/ad?...
An ad response has been received from the MoPub ad server. The response String can be found concatenated to the message. N/A [com.mopub.network.AdLoader$1][onSuccessResponse] Ad server responded with:
The creative has been loaded and is ready to show. This explanation uses banner as an example. Banner / Mrect / Interstitial loaded [com.mopub.mobileads.MoPubView][adLoaded] Ad loaded
The ad has been shown on screen. Note that this message only applies to non-banner creatives. Banner ads will display immediately upon load. Ad shown [com.mopub.mobileads.MoPubInterstitial][onCustomEventInterstitialShown] Ad shown
The impression tracker has fired. Successfully hit tracking endpoint: http://ads.mopub.com/m/imp? [com.mopub.network.TrackingRequest$1][onResponse] SDK Log - Successfully hit tracking endpoint: https://ads.mopub.com/m/imp
The clickthrough URL to be launched after the ad has been clicked. Note that this log does not mean the clickthrough redirect has begun. N/A [com.mopub.common.UrlAction][handleUrl] SDK Log - Ad event URL:
MoPub has recorded a click. This explanation uses banner an example. Banner / Interstitial /  clicked [com.mopub.mobileads.MoPubView][adClicked] Ad clicked
The click tracker has fired. Successfully hit tracking endpoint: http://ads.mopub.com/m/aclk? [com.mopub.network.TrackingRequest$1][onResponse] SDK Log - Successfully hit tracking endpoint: https://ads.mopub.com/m/aclk
The ad is about to be dismissed. This explanation uses interstitial as an example. Note that this message applies only to non-banner creatives, such as interstitial and rewarded video. N/A [com.mopub.mobileads.MoPubInterstitial][onCustomEventInterstitialDismissed] Ad will disappear
The ad has been destroyed. Any resources associated with the ad have also been released. N/A [com.mopub.mobileads.MoPubView][destroy] Ad Log - Destroy() called

Log Messages

You can monitor device logs in Android Studio documentation.

The adapter/Custom Event is missing or in the wrong location (see Network Integration documentation) or there is a mismatch between the actual custom event name and what is entered in the Networks tab of the MoPub UI.

This is an old message; check to make sure that the MoPub AdUnit ID is the same as the ID from the UI. Using a wrong value will result in this error.

This log indicates that there was no fill for your ad unit. It does not indicate that there is a problem with your integration, but you may see it in combination with another error log, such as Could not find custom event class named, so be sure to review the logs thoroughly.

Make sure to review the ad source breakdown associated with your ad unit to confirm that your ad sources are active.

Double-check that the App ID and network provided Adunit IDs entered in the UI are correct and entered in the right place. If not, Mopub SDK will be able to initiate the network, but you will not get fill.

For banners, mopub time-out limit is 10 seconds and for interstitial it’s 30 seconds. After we pinged the network, if the network does not respond within that timeout period, you will see this error. This is a network-driven issue; please reach out to your network partner.

FAQ

There could be multiple reasons why you aren’t seeing any ads in your testing. Consult the device logs to learn why.

IMPORTANT: After testing, be sure to replace the MoPub test ad units with the production ad unit IDs from your own MoPub account.

  • Yes, you can use the following testing ad unit IDs, which return the same test creatives 100% of the time.
Format Size Ad unit ID
Banner 320x50 b195f8dd8ded45fe847ad89ed1d016da
Banner (MRect) 300x250 252412d5e9364a05ab77d9396346d73d
Interstitial 320x480 24534e1901884e398f1253216226017e
Rewarded Video N/A 920b6145fb1546cf8b5cf2ac34638bb7
Rewarded Video (MRAID) 320x480 15173ac6d3e54c9389b9a5ddca69b34b
Rewarded Playable N/A 15173ac6d3e54c9389b9a5ddca69b34b
Native N/A 11a17b188668469fb0412708c3d16813

Device logs, also known as the logcat, record what is happening in your app, including actions and processes that are not visible on screen.  They can be pulled by a developer tool like Android Studio or Xcode.  If you are unsure of how to pull device logs, a developer on your team should be able to help you.

These errors indicate that there was no fill for your ad unit.

  • No ad network will have fill 100% of the time, so seeing this log is normal. New apps and apps with very low volume tend to experience lower fill rates. Contact your ad network representative if you have any concerns related to a particular network’s fill.

  • If you are consistently seeing no fill, review your ad network placement details in the Networks tab of the MoPub UI, as well as your settings in the Network’s UI.

  • You won’t be able to show ads from Certified Ad Networks if you forgot to include the network SDK or adapter files. The Couldn't locate or instantiate custom event and Unable to find Native Network or Custom Event adapter log messages are indicators that the network SDK or adapter file is missing, renamed, or in the wrong location.  Review our Integrating Third-Party Ad Networks documentation to resolve this.</div>

You’ll need to be approved for MoPub Marketplace before you can begin showing Marketplace ads.  In order to determine if your account has been approved, navigate to the Marketplace tab of the MoPub UI.

* If you haven't started the Marketplace approval process yet, you'll be prompted to enter your company and payment information. This is the first step towards approval.

* After you have entered your company and payment details, you will see an indication in yellow at the top of the page indicating that your account is under review.  Email [policy@mopub.com][8] with up to date payment information and the corresponding Android package name/iTunes App Store URL/Website URL linked to your MoPub App in the MoPub UI to complete the approval process. For faster approval, please include screenshots of the app in your Admin page (or your website's admin page) to show that you are the owner of the account in your email to policy.

Last updated October 16, 2019

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.

© 2019 MoPub (a division of Twitter, Inc.)