Test Your MoPub SDK Integration

Before you publish your app with MoPub and mediated networks, we strongly recommend that you test the 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 Marketplace 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 0ac59b0996d947309c33f59d6676399f
Banner (MRect) 300x250 2aae44d2ab91424d9850870af33e5af7
Interstitial 320x480 4f117153f5c24fa6a3a92b818a5eb630
Rewarded Video 320x480 8f000bd5e00246de9c789eed39ff6096
Rewraded Playable (MRAID) 320x480 98c29e015e7346bd9c380b1467b33850
Native N/A 76a3fefaced247959582d2d2df6f4757
Native video N/A b2b67c2a8c0944eda272ed8e4ddf7ed4

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 network 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. Device logs can be pulled by using Xcode.

  • Loading ad with MoPub server URL: http://ads.mopub.com/m/ad?…

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 Xcode’s console.

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 MPLogLevelInfo or MPLogLevelDebug when initializing the MoPub SDK. In comparison, the MPLogLevelDebug option is the more verbose among the two log levels.

    MPMoPubConfiguration * sdkConfig = [[MPMoPubConfiguration alloc] initWithAdUnitIdForAppInitialization: @"YOUR_AD_UNIT_ID"];

    sdkConfig.loggingLevel = MPLogLevelInfo;

    [[MoPub sharedInstance] initializeSdkWithConfiguration:sdkConfig completion:^{
        NSLog(@"SDK initialization complete");
    }];

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

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 has finished initializing and the completion handler will be notified immediately. It is safe to make ad requests at this time. N/A [MoPub][MoPub] SDK initialized and ready to display ads.
The MoPub SDK is about to make an ad request to the ad server. N/A [MoPub][MPBannerAdManager][YOUR_AD_UNIT_ID] Attempting to load ad
An ad request has been made to the MoPub ad server. The ad request URL can be found concatenated to the message. Loading ad with MoPub server URL: http://ads.mopub.com/m/ad?… [MoPub][MPAdServerCommunicator] Requesting an ad from Adserver:
An ad response has been received from the MoPub ad server. The response String can be found concatenated to the message. N/A [MoPub][MPAdServerCommunicator] Adserver responded with:
The creative has been loaded and is ready to show. This explanation uses banner as an example. Banner / MRect / Interstitial did load [MoPub][MPBannerAdManager][YOUR_AD_UNIT_ID] 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. Interstitial did appear [MoPub][MPInterstitialAdManager][YOUR_AD_UNIT_ID] Ad did appear
The impression tracker has fired. The impression tracking URL can be found concatenated to the message. Successfully hit tracking endpoint: http://ads.mopub.com/m/imp? [MoPub][MPAnalyticsTracker] Tracking impression:
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 [MoPub][MPAdBrowserController] Ad browser initialized with URL:
MoPub has recorded a click. This explanation uses interstitial an example. Banner / Interstitial /  clicked [MoPub][MPInterstitialAdManager][YOUR_AD_UNIT_ID] Ad will present modal
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 [MoPub][MPInterstitialAdManager][YOUR_AD_UNIT_ID] Ad will disappear

Common Error Codes

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.

Need to add the 3rd party Custom Event to the supportedCustomEvents by default.

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

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 below testing ad unit ids which will return the same ad 100% of the time.

Format Size Ad unit ID
Banner 320x50 0ac59b0996d947309c33f59d6676399f
Banner (MRect) 300x250 2aae44d2ab91424d9850870af33e5af7
Interstitial 320x480 4f117153f5c24fa6a3a92b818a5eb630
Rewarded Video 320x480 8f000bd5e00246de9c789eed39ff6096
Rewraded Playable (MRAID) 320x480 98c29e015e7346bd9c380b1467b33850
Native N/A 76a3fefaced247959582d2d2df6f4757
Native video N/A b2b67c2a8c0944eda272ed8e4ddf7ed4

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

Device logs 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.

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 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 April 01, 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.)