Mediation Test Mode
Note: The Mediation Test Mode feature is in Early Access mode.
Use mediation test mode to easily enable testing in your app without disturbing your production waterfall.
Understand Test Mode
We have built test mode into the MoPub Publisher UI, where you can register test devices, and enable test mode only for those devices, and only for the networks you want to test. You can also use it to test Marketplace line items. You can use test mode for both integration testing and production testing.
Integration Testing with Test Mode
Test mode means you no longer risk sending test ads to your users should you forget to turn off test mode. It also means we have removed the complications inherent in temporarily altering your waterfall, replacing your production ad units with our test ad units, or enabling and disabling networks in your production waterfall.
Managing the process entirely in the Publisher UI makes it easy to test your networks, as well as MoPub Marketplace. Mediation test mode also facilitates integrating new networks, and updating to each new release of the MoPub SDK and of network SDKs.
Production Testing with Test Mode
A live test uses your production waterfall, and you can enable specific line items to test using live ads. With MoPub mediation test mode, you don’t need to change anything in your production waterfall to test; you can simply turn production line items off and on for testing in this test mode.
Production testing is useful in various situations; for example, some networks don’t support test mode, and so to test, you must test in production. Live ads are real representation of how an ad would function and it is useful to test them in a very limited quantity from time to time.
Test Mode Logistics
A test device can only be assigned to one ad unit at a time. Once a test device is assigned to an ad unit, that ad unit’s information will appear next to the test device in the Test mode devices tab of the Account settings page. As long as that test device is spoken for, it will no longer appear in the list of available devices until you decouple it from that ad unit.
When an ad unit is in test mode, you can detect it in two ways:
Publisher UI: In the ad unit Mediation Test Mode page, the Test mode on switch is on.
Ad response payload: Whenever a test device requests an ad for that ad unit, the ad response payload contains the field
mediation_testwith a value of ‘1’.
Perform Integration Testing
Step 1. Register Your Test Devices
Register up to 25 test devices per platform (50 total) in your Account settings page’s Test Mode devices tab. Registering them here makes it easy to select a device from your list later, when you are assigning a test device to each desired ad unit. However, you can also register a device ad-hoc when you’re enabling an ad unit for testing.
Navigate to your Account settings page by selecting Account settings from the drop list next to your account email address in the top bar, as shown below.
Select the Test mode devices tab under Account settings. Any devices you have already registered appear here. Because a device can only be assigned to one ad unit at a time, if a device is already assigned to an ad unit, the ad unit information is displayed.
Click New Test Device. In the New Test Device page, select the platform (Android or iOS), enter the device’s name, and its device ID.
Step 2. Enable a Network for Testing
To test with a network, it must be set up in the Networks tab. You don’t have to be in production with a network to test with it, meaning that the network doesn’t have to appear in any of your waterfalls yet. Our mediation test mode is specifically geared to let you test with networks you’re about to integrate, as well as networks that are already in your waterfall. But to test with a network, you do have to:
- Integrate the network SDK on the backend.
- Add the network in the Publisher UI Networks tab.
- Verify that the network supports test mode (find the link to our docs for each supported network here).
- To test Advanced Bidding, the network you test with must support Advanced Bidding. Refer to our list of supported networks for each network’s Advanced Bidding status.
To test with a network using network test IDs:
On the backend, integrate the network’s SDK. Use our mediation integration tool to make this easy.
Consult the network-specific article under the Mediation section of our docs. Each network-specific article has a section called “Test an Ad,” with information about how (or if) that network supports test mode, and what you must do to enable it on the network side.
Typically, you will create line items (or whatever the network calls them) just for testing, and the network will assign them IDs.
In the MoPub Publisher UI, navigate to the Networks tab.
If this is a new network, follow our instructions to add a network.
Hover by the name of the desired network so that the Edit option appears as shown above, and click Edit.
In the Manage [Network] page, select the Test mode settings tab.
In this page, enter the network’s equivalent of line item IDs for the test line items you created on the network side for this purpose (you did this in the second step of this series), along with the network-specific key required for testing.
For each ad format you have integrated, enter that network’s test line item ID and other key information (such as “App ID” or “SDK Key”). Note that different ad networks have different terminology for line items (such as “zone,” “placement,” etc.), and different key information (some have “Application ID,” some have “SDK Key,” etc.). Our UI displays each network’s specific terminology.
Step 3. Enable an Ad Unit for Testing
Manage testing at the ad unit level:
In the Publisher UI, navigate to the app and ad unit you want to use for testing under the Apps tab.
Next to the Edit ad unit button on the top right, select Mediation Test Mode from the drop list.
Once you have turned an ad unit’s test mode on, it stays on until you deliberately toggle this switch off. Use the position of this switch to detect whether an ad unit is in test mode.
Assign a test device to this ad unit. Because a test device can only be assigned to one ad unit at a time, the Select test device drop list displays those devices that are not currently assigned to any ad unit.
If you need to register a new device, you can do that by clicking New Test Device and filling out the page as you would in Step 1.
Once you have specified a test device, the Test Mode section of the page displays. Here, any networks you have set up in the Networks tab display (whether or not they are currently in your waterfall). Marketplace displays as well.
Enable the network whose test ads you want to serve to your device by toggling the Select switch next to the desired network. You can only enable one network at a time.
If you entered network test line item IDs and keys for the network in Step 2, they are automatically filled in for you here, but you can overwrite them.
To test with MoPub Marketplace, simply toggle its Select switch.
Perform Production Testing
The production test allows only the one specified production line item to be used for this ad unit, provided that test mode is active for your device.
The preparation for production testing is very similar to integration testing, and most of the instructions for integration tests apply:
You must still register a test device as described in this article, either in the Account settings page or right in the ad unit test setup page.
If you are testing with networks, follow all the steps to enable a network for testing.
Finally, enable an ad unit for testing, but notice that the Test Mode section of the page has both an Integration test and a Production test mode.
To run a production test:
Click Production test to serve live ads from the line item you specify. Your production waterfall displays. Enable the line items you want to test by sending them live ads. You can search for a line item by name, or filter line items by line item type or by priority.
Toggle the Select switch next to the line items from which you want to serve live ads to your test device.
How can we make this article better for you?
Last updated March 30, 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.)