- Create an Ad Unit
- Test Mediation
- Simulate GDPR Consent
- Register and Arrange Native Ad Renderers
- View Impression Logs in the Android 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 must be used only for non-revenue-generating, internal testing purposes.
The MoPub Sample app enables you to view and test various ad formats, including:
- Medium rectangles
- Native static and video
- Rewarded video
You can now also save your own ad unit IDs for testing. Additionally, the sample app is now AndroidX compatible.
Create an Ad Unit
In the sample app, we have created a sample ad unit for each ad unit type. You can also create your own ad units in the sample app for end-to-end testing. To create an ad unit in the sample app:
- Navigate to the Apps tab, click on the sample app, and click New ad unit in the top right corner.
- Select the ad unit type from the drop menu.
- Enter the ad unit ID from your MoPub account.
- In the New ad unit page, enter a name for your ad unit.
- Select Save ad unit.
The ad unit is now listed under its corresponding ad unit type, and is ready to use.
The sample app includes fully integrated network adapters to enable mediation testing. Note that if you are building the sample app using iOS source code, you must run “pod update” from the Canary folder. For Unity, use the SDK manager.
Not all adapter versions are up to date, but you can override the versions in the following folders:
- Unity: Always up to date with the latest versions.
Note that some networks require personal keys:
- AppLovin: requires an SDK Key in
- Google (AdMob & Ad Manager): requires an app ID in
Simulate GDPR Consent
The Android sample app enables GDPR consent simulation. Select the menu bar in the upper left corner, and GDPR simulation options will be available under Privacy (grant consent, revoke consent, etc.).
Register and Arrange Native Ad Renderers
Additionally, you can reorder the renderers on the iOS sample app. Register network renderers 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.
View Impression Logs in the Android Sample App
The Android sample app enables 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.
- 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 for all fields available in the logs: