Yuma 4×4

Media and Communications

New Mediation Test Suite – Mobile Ads Garage

New Mediation Test Suite  – Mobile Ads Garage

everybody, and welcome back to the Mobile Ads Garage. Today, with the help of my
partner, Gary the graphics guy, I get to announce
something really cool, a new test suite library from
AdMob that can help you get up and running with mediation
quicker and easier. Now for those of you who
aren’t familiar with the term mediation, it’s a way
for app publishers to load and show ads
from multiple networks in a single app. We’ve done a bunch of
other episodes on it. There’s one covering just
the basics, plus a couple about our open source
mediation adapters for Android, iOS, and Unity. There are links to those videos
in the description below. So make sure you check them out. For those of you who are
familiar with mediation, you know that to
use it, you need to build a few
things into your app. In addition to the
Google Mobile Ads SDK, you also need the SDK for the
network you want to mediate, plus an adapter, and the
app settings required by that network. Verifying that you have all
the right stuff imported into your app can be tricky,
isn’t that right, Sam? SAM: Where am I? ANDREW BROGDON: Fortunately, the
new AdMob mediation test suite can help you do it. SAM: You said we were
going for coffee. How did I even get in this room? ANDREW BROGDON: Now
I’m going to take off but I’d like to introduce
Sam who is here to tell you all about this new tool. SAM: What? Where are you going? ANDREW BROGDON: Well,
you’ve heard of Flutter, Google’s new mobile
UI framework, where you build native
apps on iOS and Android from a single codebase
in record time? SAM: Yeah. ANDREW BROGDON: Oh, well
I’ve been helping out with the AdMob plug-in. They’ve got banners,
interstitials, rewarded ads, it’s pretty cool. SAM: So you’re leaving? ANDREW BROGDON: Don’t
worry, you’ll be fine. Oh, you’re coming too, Gary. You can help with the widgets. SAM: Who was he just talking to? Well, I guess we should
talk about the test suite, or suites, really,
since there’s one for iOS and one for Android,
plus a Unity package. Regardless of platform, though,
everything works the same way. The test suite is a library that
you can build into your app. And you trigger with
a call like this. In response, a new activity
or a view controller appears and automatically
fetches your mediation configurations from the server. Then you can look for your
AdMob ad units and mediation networks, pick one,
and see whether you have the right SDKs, adapters,
and settings in place. You can even make test ad
requests all from right there in your app. This way there’s
no more guesswork. You can see for yourself whether
or not everything is set up. Plus, every format is covered. You’ve got banners,
interstitials, rewarded video, and native. So that’s the broad strokes. Now let’s head into Xcode and
get the test suite into one of our example apps for iOS. OK, here we are in our
sample app in Xcode. And I have the Google
Mobile Ads framework already included using CocoaPods. So the first thing
we are going to do is look at the
developer documentation for the mediation
test suite in iOS. And the link is in
the video description. So let’s hop across now. Now, the first thing to note
here is the prerequisites. So please ensure
that you’re using at least the minimum supported
version of Xcode, which is currently Xcode 8.0. And when using the
test suite, targeting at least the minimum iOS
version, which is currently 8.0. You also need to have
an AdMob account, have at least one
app registered. And this is where
[INAUDIBLE] test suite will pull your ad units and
mediation configurations from. So next up, we will
integrate the test suite. So under installation,
you can find the line to copy across
into your podfile. So let’s copy that line
now and go back to Xcode. Now, we can copy this
into our podfile. So make sure in your podfile
that you’re targeting at least version 8.0 of iOS. And we can do a pod install. And you may need to do
a repo update or pod update depending on when
you last updated your repo. And you can see because
I’m using a mediation, I’ve got a range of mediation
ad sources in my pod file too. Now back to the code. I’m pulling up now app delegate. We have the AdMob
app ID to find here, which are we using to
configure Google Mobile ads. And we’ll be using this
to launch the test suite. So now we can integrate
the test suite. So firstly, we need to import
the test suite module, like so. And next, we are going to write
a new method, present mediation test suite, which we will use
to present the test suite. Now in the body of
this method we’ll add our call to
present, like so. And this takes three parameters. So the first is
the app ID, which is the AdMob app ID, which
we use for the ad units and mediation
configuration information, which we defined previously. So I’m going to
insert that here. Then we have a view
controller to present on. And in this case, it will
be our base view controller, which is ourself. And optionally, we can
also pass a delegate, which is a Google Mobile ads
mediation test suite delegate, which you can provide if
you want to be notified when the test suite is dismissed. So once this method is
written, we need to call it. Because the call presents
the test suite modally with animation, it’s call
can’t be made in viewdidload or viewwillappear. So you can call it
from viewdidappear or you can also invoke it
using a button or a gesture. For experience, I’ll just simply
call it from viewdidappear. So let’s just add that in now. OK, so now the
integration is done. We can check out the
test suite in action. OK, first up here we
see the disclaimer. So please be sure to read
through the text here and click through and read
the link disclaimer article. Basically, we want to
ensure that you correctly configure any third party
add sources to show test ads for the app you’re testing. If you request live ads from any
given ad source while testing, you’re likely to
be violating policy and your account
may be suspended. And the test suite
can’t configure test ads for third party sources first. So it’s up to you to make
sure this is done correctly before loading any
third party ads. So once you’re happy, click
the check box and press agree. Now we can see the home
page for the test suite. This is broken up into
multiple pages and sections. So at the top, you can see
two tabs, failing ad units and working ad units. The failing ad units page shown
here shows a list of ad units that have ad sources that
are either missing components or not fully
configured and tested. The working ad units page,
which is initially empty, will be populated
with ad units that have add all ad sources
tested successfully. Now one thing you’ll notice is
the icons under each ad unit. These icons represent a summary
status of all the ad sources that apply to that ad unit. So SDK is the status of the
SDKs required for all the ad sources. And adapter is the
status of the adapters required for the ad sources. If there’s at least one adapter
missing, this will be red. And if all the adapters are
found, it will be green. Under the configuration
error section, there’s also an ad load icon. This is initially yellow,
meaning it’s not tested. If at least one ad
source has failed a test, then this will be red. And if all ad sources
have passed the tests, it will be green. Note also that if we have a
large number of ad units, then we can use the Search button to
search the ads by ad unit ID, also by ad source
name or format. So I’ll just
demonstrate that now. So you can see it
says rewarded ads. Or if I search for an ad
source name, that will come up, and also an ad unit number. So now let’s have a look at
the interstitial ad unit we have configured for this app. Here we have a list of all
the ad sources configured for this ad unit. So this applies across
all geographic regions. We don’t separate by region. And you can see we have quite
a few ad sources configured for this ad’s ad unit. The ad sources will be arranged
from the most issues at the top to the least issues
at the bottom. So we suggest starting from the
top and working your way down to fix issues. You’ll note for each
ad source that we have the same SDK
adapter and ad load icons when SDK and adapter are found. And at this level,
these indicators apply just to each
individual ad source. So we can see all the
sources at the top are missing SDK and adapters. And further down, we see the
SDK and adapters are found, that the ad source
has not been tested and the ad load icon is yellow. Also on this page,
there is the ability to search ad sources by
name using the Search icon at the top here. Another convenient feature is
we can check multiple ad sources here and test loading
of all check ad sources from this screen. We can only check
ad sources where the SDK and adapter are found. So I’ll load a couple of tests– load a couple of ads for a
couple of the ad sources here. And you can see
that those worked and they got moved to
the bottom of the screen. Let’s look at the detail
screen for a given ad source. Now on the detail screen,
we can see more information about this ad source. We see checks for
the SDK and adapter. And we also see the parameters
that have or have not been configured. So the test suite knows
about the parameters required for all open
source ad source adapters. And we will show whether or
not these parameters have been supplied in the [INAUDIBLE]
console for the configuration question. If the SDK and
adapter are found, you will be able to load an ad. However, if the parameters
are not correctly configured, it’s unlikely the
ad load will work. So check this first. So let’s try loading an ad. Hit the ad load. You can see ad
loading in progress. And we can see it succeeded. So if interstitials as well as
rewarded ads, from this detail screen we can also
display the ads received. Banner ads will be
displayed in line. And native ads, by their custom
nature, will not be shown. Again, we emphasize that you
must have test ads configured for the given ad source before
loading and displaying ads. So let’s show the ad. OK, we can see we successfully
loaded and displayed a test ad. Back on the list
of ad sources, we can also see that we have
loaded successfully a number of ad sources. Let’s try an ad source that’s
not configured correctly. So I’m going to
hit load ad here. And notice when it fails we
don’t get a lot of information on this screen. Typically, it will
say no fill and just tell us to check
the configuration. So to debug further, you’ll
need to check your system logs. So for a failing ad load,
you should get some logs from either the
adapter or the SDK for the ad source that
explains the reason for the failure in more detail. So you can see we’ve got some
information from my target adapter here saying that it
didn’t recognize the slot ID. For some ad source
SDKs, you may need to enable debug logging to
see debug log information. So this is typically done as
a call to the top level SDK class, such as SDK
class.loggingenabled equals true. So make sure to check
that for your ad source as you’re debugging. OK, so that’s basically a
wrap of the basics of the test suite. Note that there are
some additional APIs available on the test
suite, such as the ability to configure an ad request
for test suite to use, for example, when an ad source
requires they provide extras in order to load an ad. And these extra APIs are
covered in the developer docs. Again, the link for that is
in the video description. Finally, to close
the test suite, we can just hit the
cross in the top left. Note also that the ads– the test results
for the ad sources are not persisted
across sessions. So any working ad
units will be reset when you present the
test suite the next time. All right, so that’s the basics
of using a test suite in iOS. You might have noticed that
not every mediation network supported by AdMob were
listed in the test suite. Right now the suite works
with a dozen or so networks who’ve joined our open
source initiative. It’s possible that the team
might expand on that later, but for the initial
release, that’s the list. All right, time for Android. Since the test suite works the
same on both iOS and Android, I’m going to save some
time here and just focus on importing and launching
the test suite activity. Let’s get into Android Studio. Here we are in our sample
app in Android Studio. And I have the Google Mobile
ads dependency already included using Gradle. So the first thing
we’re going to do is look at the
developer documentation for the mediation
test suite in Android. The link is in the
video description. So the first thing to note
here is the prerequisites. So please ensure you are
using the minimum supported version of Android, at least
which is currently API level 14. And also including at
least the minimum version of Google Play services, which
is currently version 9.8.0. You’ll also need AdMob
account with at least one app registered. It’s where the test suite
will pull your ad units and mediation
configurations from. So next up, we’ll
integrate the test suite. So under installation
here, you can find the line to copy across
into your build up Gradle file. So let’s copy that and go
back to Android Studio. Now, in our built
up Gradle we’ll pop that line in under
the ads dependency. Make sure in here as well
that you have the minimum SDK version. I’m on 16 here. And you can also see,
because I’m using mediation, I’ve got a range of mediation
ad sources in here as well. So now we can integrate
the test suite. In Android, we can launch the
test suite from On Create. So I’ll just add the call here. So it’s mediation test
suite at dot launch. Now this takes two parameters. One is a context, which is
the activity context used to launch the test suite. So I’ll just use
my current context. And the other one
is the AdMob app ID to use for the ad units
and mediation configuration information. I’ve already supplied
that here when I called mobileads.initialize. So I’ll just reuse that. Now, there are other
APIs that enable us to set a listener for when
the test suite is dismissed, and also for us to set an
ad request to use to supply [INAUDIBLE] bundles
for ad sources that need extra configuration
information. And these IPs are documented
in the developer documentation linked in the video description. So now the integration is done. Let’s check out the
test suite in action. As you can see, we’ve
got the disclaimer here. And if I agree to
that, everything looks very similar to
iOS, very much the same. So I won’t go over the usage. One thing that does
differ in Android is you’ll note we have
an icon for manifest. This represents a check of
whether you have correctly added all required manifest
entries where applicable for a given ad source. So this includes
permissions and activities. Apart from that,
everything is the same. All right, that’s Android. There’s one last
thing to show you, which is how people
building apps with Unity can take advantage of
the test suite too. To help simplify
things, the team put together a Unity package
that imports the native test suite libraries for you. It also provides a
c-sharp interface so you can make the call
to launch the test suite right from your unity code. Let’s hop into the Unity
IDE and see how it works. OK, here we are
in the Unity IDE. And I have a small
sample project with the Google Mobile ads
Unity package already installed. So the first thing
we’ll do is look at the developer documentation
for the mediation test suite for Unity. So let’s head over to that. And note, again, we
have some prerequisites. So we need to have the
Google Mobile Ads Unity package in our Unity Project. And we need to have
our player settings targeting the minimum
iOS and Android versions. And we also need to
have an AdMob account with an app registered
for each platform, which is what we’ll be
using to pull down the ad units in our
mediation configurations. So next we’ll download the
mediation test suite package here. So let’s just click
and download that. And with our project open,
we can just click on that. And in Unity we will see
the import window pop up. So we want to import
all of the package. And this will then
import all the assets and also run the
[INAUDIBLE] over to get all the dependencies. So let’s just let
that run for a second. And the next thing we
can do is head over to our script in Visual Studio. So to save time,
I have prefilled a couple of things in here. So you can see I’ve
written a method to show the mediation test
suite, but it’s not completed. I’ve also got a handle test
suite dismissed event handler. And I’ve also
configured a button in my GUI to show the
mediation test suite. However you choose to
do this is up to you. To actually interact
with the test suite, we’ll need to use the Google
Mobile Ads mediation test suite API. And two things we’ll do. So firstly, you can see
we have our app IDs, which are the AdMob ap
IDs that we’re going to use to show the test suite. So the API that we’re going
to call to show the test suite is just mediationtestsuite.show. And we’ll parse in the app ID
that we’ve already configured. So it needs to be
a different app ID for Android and for iPhone. Now this event
handler here we can call using mediationtestsui
te.onmediationtesuitedismissed. And we’ll add our event handler
to that property like so. And that will notify us
when the mediation test suite is dismissed, in case
we want to pause or resume our game. And that’s all we actually
need to do to configure the basics of the test suite. There is an
additional API for us to configure an ad
request if we need to parse in some extras
for one of the ad sources. And the details for that are
in the developer documentation. For actually using
the test suite, refer to the iOS and Android
portions of this video with the details of
how to use the test suite on those platforms. All right, so that’s
the test suite in iOS, Android, and Unity. If you’re a publisher
using mediation, download it and give it a try. In the meantime, I’ve got
some resources for you in the description below. There are links to the
Android, iOS, and Unity guides for the test suite, plus
links to our mediation guides for those platforms. And if you have questions
or run into a problem while using the test suite, you’re
welcome to stop by our support forum. And as always, if
you have a question about this video or a
suggestion for a topic to cover, leave a comment below and
we’ll see you next time. [MUSIC PLAYING]

12 thoughts on “New Mediation Test Suite – Mobile Ads Garage

  1. That sounds great. Was facing some difficulty in implementation of Mediation of Facebook, will try with this.
    Thanks Team Google.

Leave comment

Your email address will not be published. Required fields are marked with *.