- About the MoPub Sample App
- Setting Up An Ad Unit
- Testing SKAdNetwork
- GDPR Simulation
- Native Ad Renderers
- Android Logs
About the MoPub Sample App
The MoPub Sample App is for anyone who has a stake in how a creative or tag functions in a MoPub-integrated app:
- Publishers and app developers: Use the MoPub Sample App as a reference implementation to troubleshoot possible MoPub-SDK integration issues.
- Demand-side partners: Use the MoPub Sample App as a reference implementation for how all MoPub-integrated inventory will function, so that you can focus on developing the creative that works across various publishers’ apps.
- Rich-media partners: Use the MoPub Sample App for rich-media certifications.
Use our sample app with the understanding that it will be used only for non-revenue-generating, internal testing purposes.
The MoPubSample app enables you to view and test various ad formats, including:
- Medium Rectangles
- Native static and video
- Rewarded Ad
You can now also save your own ad unit IDs for testing. Additionally, the sample app is now AndroidX compatible.
Setting Up An Ad Unit
To set up an ad unit to test in the sample app, follow these instructions to create an ad unit. Then follow the instructions to create a line item. If you want to test a specific creative tag, you can set up a Guaranteed line item, which enables you to upload the creative directly. If you want to test how your bidder responds in the marketplace, create a marketplace line item and contact your account team to allowlist your DSP (to ensure it is the only participant in the auction). Learn more about line item types here.
To test your bidder end-to-end, your account must have the following to be included in auctions:
Your account must have a domain set. You can find this under your account settings.
The sample app comes with an example ad unit for each ad unit type, but you can also create your own ad units in the app for end-to-end testing. To set up an ad unit in the sample app:
- Click New ad unit.
- Select the ad unit type from the drop-down menu.
- Enter the ad unit ID from your MoPub account.
- Name the ad unit.
- Click Save ad unit.
The ad unit will now be listed under its corresponding ad unit type and is ready to use.
You can use the iOS MoPub Sample App to test your SKAdNetwork integration. Refer to the complete instructions.
Note that the sample app is not integrated with our full
info.plist file. To ensure that your SKAdNetwork ID is in the
info.plist file for end-to-end testing, we recommend that you download the build from our GitHub and add your SKAdNetwork ID to the
info.plist file if it is not there. If your SKAdNetwork ID is already in the sample app
info.plist file, you can test end-to-end from the app in the app store.
The Android sample app now allows for GDPR consent simulation. Select the menu bar in the upper left hand corner, and GDPR simulation options will be available under “privacy” (grant consent, revoke consent, etc.)
Native Ad Renderers
Additionally, you can reorder the renderers on the iOS sample app. Network renderers should be registered first. To rearrange native renderers on iOS, swipe left to open the menu bar in the app, scroll down to “native renderer” and select “change order”.
The android sample app allows you to view impression logs in JSON format. To view impression logs, select the three-button menu in the top right corner.
Select Clear logs to clear out the logs, and select Impressions to view the logs. Here you will find a list of JSON objects with impression log data for all impressions rendered on the sample app. Refer to the image below with all fields available in the logs:
How can we make this article better for you?
Last updated August 28, 2021
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.
© 2021 MoPub (a division of Twitter, Inc.)