Mediation Test Suite Beta

The AdMob Mediation Test Suite allows you to test whether you have correctly configured your application and ad units to be able to display ads from third-party networks via AdMob mediation.

This guide outlines how to use the AdMob Mediation Test Suite in your Unity app. The first step is integrating the tool into your app.

Prerequisites

Installation

Download Mediation Test Suite

After downloading the Mediation Test Suite, with your Unity project open, double-click the Unity package and import the files into your project.

Once this is complete, you have integrated the GoogleMobileAdsMediationTestSuite into your Unity project.

Launching the Mediation Test Suite

To include the test suite into a script, you must first add the following imports:

using GoogleMobileAdsMediationTestSuite.Api;

Next, call MediationTestSuite.Show() with your AdMob App ID as the parameter to launch the test suite. You can find the App ID for your app in the AdMob UI.

private void ShowMediationTestSuite()
{
    #if UNITY_ANDROID
    string appId = "<Your Android application ID>";
    #elif UNITY_IPHONE
    string appId = "<Your iPhone application ID>";
    #else
    string appId = "unexpected_platform";
    #endif

    MediationTestSuite.Show(appId);
}

The Unity plugin provides a convenient wrapper to enable you to easily integrate and launch the test suite from the Unity environment. Once the test suite is launched, it looks the same as the iOS and Android test suites. Follow these respective guides for help navigating the test suite.

Knowing when the Test Suite is dismissed

If you want to be notified when the test suite is dismissed, you can register a delegate to the MediationTestSuite.OnMediationTestSuiteDismissed event handler.

public void Start()
{
    MediationTestSuite.OnMediationTestSuiteDismissed += this.HandleMediationTestSuiteDismissed;
}

public void HandleMediationTestSuiteDismissed(object sender, EventArgs args)
{
    MonoBehaviour.print("HandleMediationTestSuiteDismissed event received");
}

One practical use case for this event is to know when to resume your game.

Configuring ad requests with network extras (optional)

Certain mediated networks, such as Vungle, require or have the option to provide a custom network extras object to provide additional information to requests to their network. If you need to provide network extras for your mediation requests you can set an ad request for the test suite to use using the MediationTestSuite.AdRequest static property:

AdRequest adRequestBuilder = new AdRequest.Builder();
...
// Set your network extras for your chosen networks here.
// i.e for each network extras object, call
// 'adRequestBuilder.AddMediationExtras(<network extras>)'
...
MediationTestSuite.AdRequest = adRequestBuilder.Build();

Ensure that you do this before calling MediationTestSuite.Show().

This enables you to instantiate and configure an ad request with any required extras, which the test suite can then use in its request to the mediated network.

Frequently Asked Questions

Does the disclaimer show every time?
Yes, we do this intentionally as a reminder that pubs should turn on test mode for their mediation ad sources.
Why do I see AdMob multiple times on the Ad Unit details page?
If multiple mediation groups target the same ad unit, we combine all of the groups together. For example, you may see multiple AdMob entries and possibly multiple of other ad sources. Even inside the same mediation group, a mediation partner can be defined up to 3 times.
Which networks / ad sources are supported by the mediation test suite?
The test suite works for all open source and versioned adapters as well as custom event adapters. The ad networks in our open source initiative are listed on our mediation page.

Send feedback about...

Google AdMob > Mobile Ads SDK > Unity
Google AdMob > Mobile Ads SDK > Unity
Need help? Visit our support page.