Posted:

With the advent of video players that support streaming media formats such as HLS and DASH, publishers can now easily support these formats with the IMA SDK for Android. Here is a list of steps to make this work:

  • Use a video player that can play streaming video, such as ExoPlayer.
  • Inform the SDK of your video player's capabilities.

The latter is done via the SDK's AdsRenderingSettings API. Create a new instance of AdsRenderingSettings and then create a list of MIME types you plan to support:

AdsRenderingSettings adsRenderingSettings = 
    ImaSdkFactory.getInstance().createAdsRenderingSettings();
ArrayList arrayList = new ArrayList();
arrayList.add("application/x-mpegURL"); //HLS
arrayList.add("application/dash+xml"); //DASH
adsRenderingSettings.setMimeTypes(arrayList);

Then initialize the AdsManager using these AdsRenderingSettings:

adsManager.init(adsRenderingSettings);

This will allow the SDK to choose streaming ad media to play in your video player. Make sure to add any additional MIME types you plan to support, such as MP4, as this approach assumes that any MIME types not passed in are not supported.

FAQ

How do I play HLS ads using the IMA SDK for iOS?

The default video player used by the iOS IMA SDK supports HLS, so it is not necessary to set that in AdsRenderingSettings.

Will this work with the SDK-owned player?

No, currently you must use custom playback by implementing the VideoAdPlayer interface. For an example of how to do this, check out our guide on custom playback or AdvancedExample.

If you have any questions, feel free to contact us via the support forum.

Posted:

If you've created a Native Express ad unit recently, you may have noticed a new template format alongside App Install and Content: Video App Install. In the past few weeks, AdMob has rolled out support for video assets in Native Ads Express, giving publishers a new way to create more engaging presentations for their users.

How to get started

Enabling video demand for a Native Express ad unit is easy. Just open the ad unit's settings in the AdMob console, and look for the Ad type checkboxes at the top of the editor:

Check the checkbox marked "Video app install," and save the change. In a short while, your ad unit will start serving video creatives alongside the other two formats, with no code changes to your app required. That means you can update your existing apps to display this new format without redeploying to the Play Store or App Store.

An important thing to note is that video creatives are only available for ad units using the Large template size. The video player needs a certain amount of space, and the Large template ensures that it's available.

Customizing the experience

While there's no mobile code required to take advantage of Native Express Video, AdMob has introduced some new features to the API that allow publishers to customize the user experience. In particular, a new video options class (VideoOptions on Android, and GADVideoOptions on iOS) gives publishers a way to influence how the ads behave.

For example, the following code will cause video ads appearing in an Android NativeExpressAdView to begin playing with their audio on:

mAdView = (NativeExpressAdView) findViewById(R.id.adView);
mAdView.setVideoOptions(new VideoOptions.Builder()
    .setStartMuted(false)
    .build());

Staying in the know

App publishers can retrieve information about the video assets in their ads through the use of a video controller object (VideoController on Android, GADVideoController on iOS). The ad view classes for native express have been updated to include video controller properties that apps can grab and query for info like whether a video is present in the ad, and what its aspect ratio is. Even if the ad doesn't contain an video asset (or no ad has been loaded at all), you'll always get a valid reference to the ad view's video controller.

For example, here's a Swift snippet that shows how to check if an ad that just loaded contains a video asset:

func nativeExpressAdViewDidReceiveAd(_ nativeExpressAdView: GADNativeExpressAdView)
{
  if nativeExpressAdView.videoController.hasVideoContent() {
    print("Received an ad with a video asset.")
  } else {
    print("Received an ad without a video asset.")
  }
}

More Info

Native Express is designed to make implementing native ads easy, but if you have questions about how to get up and running or how you can best put it to use in your apps, stop by our support forum. The Mobile Ads Garage recently released an episode covering Native Express Video as well, with feature details and screencasts for iOS and Android:

Posted:

Today we're excited to announce iOS and Android sample projects that display AdMob Native Express ads in a feed. These samples address a common use case for monetizing apps with feeds or lists of content. The iOS (Swift and Objective-C) apps display Native Express ads in a UITableView and the Android app shows them in a RecyclerView.

Native Express ads work well in lists of content for two reasons. First, impressions are not counted until the ad is on screen, which enables you to preload the ads ahead of time. Preloading can help with optimizing scroll performance by making sure the ad is ready to be displayed when the user scrolls through the list. Second, you have more control over the styling of the ads, allowing you to create presentations that fit naturally with your content.

You can check out these sample apps by downloading them from our iOS and Android GitHub repos, and you can see them being coded in the Mobile Ads Garage YouTube series. Episode 11 walks you through the implementation for adding native ads into an Android RecyclerView. Episode 12, which will cover the implementation of native ads in an iOS UITableView, is due out next week.

If you have any questions or feedback regarding our SDK, feel free to contact us through our forum.

Posted:

Episode 11 of The Mobile Ads Garage is live on YouTube! If you haven't seen it before, The Mobile Ads Garage is a video tutorial series that covers how to use the Mobile Ads SDK to display ads from AdMob and Doubleclick for Publishers. Each episode covers one aspect of the SDK, breaks down the feature, and shows screencasts of real implementations on both Android and iOS – all in a friendly format.

In a break with tradition, this video is a deep technical dive on one subject: Native Ads Express in an Android RecyclerView. You'll learn how to modify an existing RecyclerView implementation to include Native Express ads, all the way from updating the adapter to loading the ads. In addition, you'll get a clever trick that makes sure your ads are always sized to match the UI, so they fit right in with your content.

If you haven't used Native Ads Express before, you can see them in action in Episode 7. Andrew and Gary cover all the basics: loading ads, placing them in layouts and storyboards, and using CSS to style the ads to match your app.


If you like the video, save the Mobile Ads Garage playlist to your YouTube Playlist collection and you'll never miss an episode.

We'd love to hear which AdMob features you'd like to learn more about. The comment sections for the videos are open, and you're welcome to toss out ideas for new episodes and examples you'd like to see. If you have a technical question relating to something discussed in one of the episodes, you can bring it to our support forum.

Until next time, be sure to stay connected on all things AdMob by following our Twitter, LinkedIn and Google+ pages.

Posted:

On February 1, 2017, we will implement a new deprecation policy for the IMA SDKs for iOS and Android. The Flash and HTML5 SDKs are unaffected by this policy because they are downloaded at runtime, so all developers are always using the latest version.

Each release will be deprecated 12 months after its successor is released.

As of February 1, 2017, the following SDK versions will no longer be supported:

  • IMA Android prior to version 3.1.3
  • IMA iOS prior to version 3.1.0

If you are currently on one of these versions, we strongly suggest upgrading to the latest version before the new policy takes effect.

Once an SDK version is deprecated, we cannot guarantee that version will continue to work. If we receive reports of crashes related to a deprecated version of the IMA SDK, we may discontinue serving ads to that version. We will also no longer field support requests for these versions on the IMA SDK support forum.

To maintain support, publishers on the latest version of an SDK will have 12 months to move to a new version once its successor is released. To "support" an SDK means we will investigate bugs in that SDK version and work on fixes. If a bug fix requires a change to the library itself, the fix will be applied to the newest version.

For a list of supported SDK versions and their deprecation dates, see the new deprecation schedule pages for iOS and Android. As always, if you have any questions, feel free to contact us via the support forum.

Posted:

Integrating with the IMA SDK for Android has historically meant implementing the VideoAdPlayer interface and playing video ads in your content player. While this approach offers maximum flexibility, it also requires a lot of extra work to get up and running. In our mission to make developers' lives easier, we are proud to offer an alternative: SDK-owned ad playback, added in our newest release, v3.5.2.

Using SDK-owned ad playback, the SDK takes care of playing ads in its own player, allowing you to focus on content playback and the normal ad request flow in your player. With SDK-owned playback, you no longer have to implement a VideoAdPlayer, or worry about VideoAdPlayerCallbacks. Enabling SDK-owned playback is straightforward: simply omit the setAdPlayer call on your AdDisplayContainer.

With the new, simplified integration flow using SDK-owned playback, integrating with the IMA SDK for Android is easier than ever! For a step-by-step guide, head over to our revamped Get Started guide or download the BasicExample project from GitHub and try it out.

SDK-owned ad playback allows publishers to simplify their IMA implementation, but using it is not required. If you already have a VideoAdPlayer implementation or want to use a single video player for both ads and content, you can keep using custom playback. SDK-owned playback merely gives you the option to let the SDK handle some of the implementation complexity for you.

If you have any questions about SDK-owned playback, feel free to contact us via the support forum.

Posted:

Episode 10 of The Mobile Ads Garage is live on YouTube! If you haven't seen it before, the Mobile Ads Garage is a video tutorial series that covers how to use the Mobile Ads SDK to display ads from AdMob and DoubleClick for Publishers. Each episode covers one aspect of the SDK, breaks down the feature, and shows screencasts of real implementations on both Android and iOS – all in a friendly format.

Knowing what's going on with your ads is a big part of maintaining a great user experience. In the latest episode of the Mobile Ads Garage, you'll see how to tap into the ad lifecycle so your app's informed of loads, clickthroughs, and other key events. You'll also get a detailed breakdown of the steps that occur in the life of an ad, info about which classes and callbacks to use for common tasks like pausing game engines and muting audio, and a real world example of how to put it all together.


If you like the video, save the Mobile Ads Garage playlist to your YouTube Playlist collection and you'll never miss an episode.

We'd love to hear which AdMob features you'd like to learn more about. The comment sections for the videos are open, and you're welcome to toss out ideas for new episodes and examples you'd like to see. If you have a technical question relating to something discussed in one of the episodes, you can bring it to our support forum.

Until next time, be sure to stay connected on all things AdMob by following our Twitter, LinkedIn and Google+ pages.

Posted:

Following its launch at the 2016 Game Developer’s Conference, AdMob’s mediation support for rewarded video ads has been a hit with publishers and users alike, with rapid adoption on both Android and iOS platforms.

Our growing list of mediation partners includes eight different ad networks. Choosing AdMob for your rewarded video mediation platform gives you access to ad content from all of them, while you develop against a single API from AdMob. Now, with the launch of custom events for rewarded video, you can also request and display rewarded videos from ad networks that are not directly supported by AdMob.

Our implementation guide for rewarded video adapters (Android | iOS) outlines how to implement an adapter that can serve rewarded video ads from a third party ad network. Special attention should be paid to steps specific to custom events that are summarized below:

Adding a custom event to your ad unit

To define a custom event, you must first create it in the AdMob interface at apps.admob.com. You can find instructions for creating a custom event in this help center guide.

Retrieving server parameters

The optional server parameter passed to your custom event is accessed via a special key. Here’s an example showing how to access the value in a rewarded video adapter:

Android

String parameter = serverParameters.getString(
    MediationRewardedVideoAdAdapter.CUSTOM_EVENT_SERVER_PARAMETER_FIELD);

iOS

NSString *parameter = [self.connector.credentials
    objectForKey:GADCustomEventParametersServer];

You can find additional documentation on rewarded video ads in our Get Started guides (Android | iOS), and more information about mediation is available in our mediation guides (Android | iOS). For any other questions about rewarded video mediation, you can reach us through our developer forum.

Posted:

Episode nine of The Mobile Ads Garage is live on YouTube! If you haven't seen it before, The Mobile Ads Garage is a video tutorial series that covers how to use the Mobile Ads SDK to display ads from AdMob and DoubleClick for Publishers. Each episode covers one aspect of the SDK, breaks down the feature, and shows screencasts of real implementations on both Android and iOS – all in a friendly format.

In this episode of The Mobile Ads Garage, we discuss mediation, which is a way for publishers to get multiple networks of advertisers competing to display ads in their apps. We’ll show you how AdMob mediation works and what it can do for your business. Learn the pros and cons of mediation, see the details of implementation, and find out whether it’s right for your app. You'll also get screencasts for Android and iOS showing the integration of a third-party SDK, plus links to samples, written resources, and Gary the Graphics Guy acting like his usual, snarky self.

If you like the video, save the Mobile Ads Garage playlist to your YouTube Playlist collection and you'll never miss an episode.

We’d love to hear which AdMob features you’d like to learn more about. The comment sections for the videos are open, and you're welcome to toss out ideas for new episodes and examples you'd like to see. If you have a technical question relating to something discussed in one of the episodes, you can bring it to our support forum.

Posted:

We recently launched v3.0.7 of the Google Mobile Ads Unity Plugin. The updated v3.0.7 Unity package is available for download from the Google Mobile Ads Unity Plugin GitHub repository.

Native Ads Express

This release introduces support for Native Ads Express. With Native Ads Express, you can create CSS templates that define how ads are presented in your app (things like image sizes, fonts, colors, and so on). These CSS templates are used to generate ad creatives that complement the native look and feel of your app. You can find more information on integrating Native Ads Express into Unity applications in our developer docs.

Android IL2CPP

The v3.0.7 release resolves compatibility issues with the IL2CPP scripting backend and the Google Mobile Ads Unity Plugin. This allows the use of the the IL2CPP scripting backend, a high-performance alternative to the Mono virtual machine and AOT compiler, in Unity applications with the Google Mobile Ads SDK.

The source code and a sample app for the plugin are available in our GitHub repo, as is a changelog for this release. If you have any questions about Unity integration, you can reach us on our developer forum.

Posted:

A new episode of The Mobile Ads Garage has hit YouTube! If you haven't seen it before, The Mobile Ads Garage is a video tutorial series that covers how to use the Mobile Ads SDK to display ads from AdMob and Doubleclick For Publishers. Each episode covers one aspect of the SDK, breaks down the feature, and shows screencasts of real implementations on both Android and iOS – all in a friendly format.

Have you tried AdMob's Native Ads Express? It's a new native ads format open to all AdMob publishers that can help you slim down the monetization code in your apps, plus give you the chance to update your ad layouts without a redeploy. In this episode you'll see sample ads, implementations in Xcode and Android Studio, and details on how to create CSS templates that'll make sure the ads in your apps look the way you want. If you've been considering a move to native ads, this is a great way to get started.


If you like the video, save the Mobile Ads Garage playlist to your YouTube Playlist collection and you'll never miss an episode.

We’d love to hear which AdMob features you’d like to learn more about. The comment sections for the videos are open, and you're welcome to toss out ideas for new episodes and examples you'd like to see. If you have a technical question relating to something discussed in one of the episodes, you can bring it to our support forum.

Posted:

A new episode of The Mobile Ads Garage has hit YouTube! If you haven't seen it before, The Mobile Ads Garage is a video tutorial series that covers how to use the Mobile Ads SDK to display ads from AdMob and Doubleclick For Publishers. Each episode covers one aspect of the SDK, break down the feature, and show screencasts of real implementations on both Android and iOS – all in a friendly format.

In the last episode, Andrew and Gary the Graphics Guy showed you how to implement AdMob interstitials on iOS and Android. Now they're back to show you how to put interstitials to work in the best ways possible. When is the best time to display? How early should you request an ad, and how often should your users see one? You'll get answers to these questions and more, along with cupcakes, cats who can play chess, and what appears to be a cloning incident gone awry.


If you like the video, save the Mobile Ads Garage playlist to your YouTube Playlist collection and you'll never miss an episode.

We’d love to hear which AdMob features you’d like to learn more about. The comment sections for the videos are open, and you're welcome to toss out ideas for new episodes and examples you'd like to see. If you have a technical question relating to something discussed in one of the episodes, you can bring it to our support forum.

Posted:

During the keynote at I/O 2016, we announced that Firebase has become a complete mobile platform that helps developers build high-quality apps, grow their user base, and earn more money. AdMob is part of how Firebase helps publishers earn revenue, and now that the dust has settled on I/O, you might have some questions about what the change means and how it affects people already monetizing with AdMob ads.

How does this affect my existing apps?

The short answer is: however you want it to. The apps you've already built are just fine the way they are, and they can keep monetizing with AdMob exactly as they do now, without changes. We've also made sure that when you do make the decision to integrate Firebase, the process is simple and straightforward. You can link your AdMob apps to Firebase projects right from the AdMob console. Firebase Analytics comes out of the box with the Firebase SDK, and you're free to choose the particular combination of Firebase services that fits your app.

Do I have to use Firebase with my new apps?

Nope. If you prefer to use AdMob by itself, that's just fine. You can import the Google Mobile Ads SDK the same way you do now, and continue to create ad units, campaigns, and reports at apps.admob.com.

My app is small! How big is the Firebase SDK?

We know SDK size is a big deal for mobile developers, and Firebase has been designed from the start to minimize its footprint. Publishers can pick and choose which services they're interested in, and only need the gradle libraries and frameworks they actually use. In our testing on Android, for example, importing the Mobile Ads SDK using the firebase-ads:9.0.0 gradle library instead of play-service-ads:9.0.0 increased the post-ProGuard size of our banner example's APK by about 100kB (though your results may vary).

Which Firebase service should I start with first?

All of the services are built to help mobile developers through the “develop, grow, and earn" lifecycle, so it depends which stage you’re at. Analytics, though, is something that every app can benefit from. Just by registering a Firebase project and importing the Firebase SDK into your app, you can start monetizing more intelligently with Firebase's free and unlimited analytics solution. Things like sessions, user demographics, revenue from in-app products, and a lot more will appear in the Firebase Analytics dashboard, with no extra code required.

Publishers can also add their own Analytics events and track them to improve their monetization strategy. For example, by adding events to monitor how users navigate between screens within an app, publishers can better understand the flow of action and find the best places to show interstitials without disrupting their users.

Are AdMob's developer resources going away?

No. The developer site has moved to a new domain, and we've added new content where appropriate, but everything you're used to is still there.

Our samples for iOS and Android now include the Firebase SDK when they build. We've also changed our quick-start guides for iOS and Android to help publishers get on board with Firebase, and the guys behind the Mobile Ads Garage are cooking up a new episode right now.

For more direct support, Firebase has a bunch of options, and as always, If you have technical questions about the Mobile Ads SDK, you're welcome to stop by our support forum.

Posted:

The Mobile Ads Garage is a new series that covers how to use the Mobile Ads SDK to display ads from AdMob and Doubleclick For Publishers. Each episode will cover one aspect of the SDK, break down the feature, and show screencasts of real implementations on both Android and iOS – all in a friendly format.

With two episodes on banner ads on the books, the Mobile Ads Garage now turns its focus to interstitial ads.

Andrew and Gary the Graphics Guy are back this week with a detailed explanation of the interstitial ad lifecycle, how to load ads, and how to display at just the right time. Along the way you'll get screencasts of Android Studio and Xcode, plus links to guides, samples, and other resources.


If you like the video, save the Mobile Ads Garage playlist to your YouTube Playlist collection and you'll never miss an episode.

We’d love to hear which AdMob features you’d like to learn more about. The comment sections for the videos are open, and you're welcome to toss out ideas for new episodes and examples you'd like to see. If you have a technical question relating to something discussed in one of the episodes, you can bring it to our support forum.

Posted:

Ever wondered about the best ways to monetize with banner ads while maintaining a great user experience? If so, the Mobile Ads Garage is here to help. In the third episode, Andrew and Gary the Graphics Guy cover how to integrate banner ads into a mobile app's UX, with a little help from Aunt Betty, hairless cats, and discount moose repellent. You'll see detailed breakdowns of things to avoid, plus reliable best practices that you can take back to your own apps. As always, links to guides, samples, and other resources are included.


If you like the video, save the Mobile Ads Garage playlist to your YouTube Playlist collection and you'll never miss an episode.

We’d love to hear which AdMob features you’d like to learn more about. The comment sections for the videos are open, and you're welcome to toss out ideas for new episodes and examples you'd like to see. If you have a technical question relating to something discussed in one of the episodes, you can bring it to our support forum.

Posted:

Registering for banner and interstitial ad events is a handy way for Unity developers using the Google Mobile Ads Unity Plugin to track ad lifecycle events -- things like when an ad is loaded or when an ad click causes the app to be backgrounded. For Unity developers deploying to the Android platform, though, it's important to be aware that ad event handler methods are not invoked on the main thread. As a consequence, Unity methods that must be called on the main thread cannot be executed within ad event handler methods.

Consider the following example:

AudioSource audio = GetComponent<AudioSource>();
...
public void HandleInterstitialClosed(object sender, EventArgs args)
{
    audio.mute = false;
}

The code above, which modifies the volume of an audio source from within an ad event handler method, results in the following error:

ArgumentException: set_volume can only be called from the main thread

To get around this, we recommend setting a flag when an event happens, and polling for a state change within the Update() method of your Unity script.

For actions required to be performed on the main thread after showing an ad, set a flag on the OnAdClosed ad event. The update method can poll the value of this flag and perform actions as necessary. The code below illustrates how to implement this approach.

private bool interstitialClosed;

void Start()
{
    InterstitialAd interstitial = new InterstitialAd("YOUR_AD_UNIT_ID");
    interstitial.OnAdClosed += HandleInterstitialClosed;
    interstitialClosed = false;
    ...
}

void Update()
{
    if (interstitialClosed)
    {
        // Perform actions here.
        audio.mute = false;
    }
}

public void HandleInterstitialClosed(object sender, EventArgs args)
{
    interstitialClosed = true;
}

If you have any questions about Unity integration, you can reach us on our forum. You can also find our quick-start guide here. Remember that you can also find us on Google+, where we have updates on all of our Google Ads developer products.

Posted:

The Mobile Ads Garage has returned with its second episode. In this video, you'll see screencasts and detailed breakdowns of how to implement banner ads for both iOS and Android. Plus, you'll get links to guides, samples, and other great resources.


If you like the video, save the Mobile Ads Garage playlist to your YouTube Playlist collection and you'll never miss an episode.

We’d love to hear which AdMob features you’d like to learn more about. The comment sections for the videos are open, and you're welcome to toss out ideas for new episodes and examples you'd like to see. If you have a technical question relating to something discussed in one of the episodes, you can bring it to our support forum.

Posted:

In our ongoing efforts to make developing with the IMA SDK easier, we’re pleased to announce that as of version 3.2.1, the IMA SDK for Android is now available on JCenter.

With this release, it's now quicker than ever to integrate with the IMA SDK. Simply make sure you include JCenter in your list of repositories:

repositories {
   jcenter()
}

Then, in your build.gradle's dependencies, include the following compile directive:

compile 'com.google.ads.interactivemedia.v3:interactivemedia:3.2.1'

If you're modifying an existing sample, make sure to remove the IMA SDK JAR file from your libs folder. This directive includes the SDK, and if you already have the SDK JAR in libs, you’ll get errors for having two copies of the same library.

If you have any questions about these changes, feel free to contact us via the support forum.

Posted:

Today, the first episode of the Mobile Ads Garage hits YouTube! The Mobile Ads Garage is a new series that covers how to use the Mobile Ads SDK to display ads from AdMob and Doubleclick For Publishers. Each episode will cover one aspect of the SDK, break down a feature, and show screencasts of real implementations on both Android and iOS – all in a friendly format.

The series will make its home on YouTube's Google Developer Channel, where you'll find the first episode in the Mobile Ads Garage playlist along with a sneak peek of the next four.


In addition to being a new way that people can find out about the SDK and how to use it, the series is a way for publishers to let us know what features they'd like to learn more about. The comment sections for the videos are open, and you're welcome to toss out ideas for new episodes and examples you'd like to see. If you have a technical question relating to something discussed in one of the episodes, you can bring it to our support forum.

Posted:

At the 2016 Games Developer’s Conference, we announced a new addition to the AdMob mediation platform: rewarded video ads. This new avenue for monetization offers users the option to engage with ads in exchange for in-app rewards. Our growing list of mediation partners includes:

  • Unity Ads
  • Chartboost
  • Vungle
  • AdColony
  • AppLovin
  • Fyber
  • Upsight

Choosing AdMob for your rewarded video mediation platform gives you access to ad content from all of these networks, and allows you to develop against a single API from AdMob.

Rewarded video ads are requested and displayed using the the new RewardedVideoAd and GADRewardBasedVideoAd classes. Here’s an example showing how to request a rewarded video ad on Android:

RewardedVideoAd mRewardedVideoAd = MobileAds.getRewardedVideoAdInstance(this);
mRewardedVideoAd.setRewardedVideoAdListener(this);
mRewardedVideoAd.loadAd(AD_UNIT_ID, new AdRequest.Builder().build());

And here’s the iOS equivalent:

GADURewardBasedVideoAd *rewardedVideo = [GADRewardBasedVideoAd sharedInstance];
rewardedVideo.delegate = self;
[rewardedVideo loadRequest:request withAdUnitID:adUnitID];

You can find additional documentation on rewarded video ads in our publishers get started guides (Android | iOS). Mediation documentation not specific to rewarded video ads can be found in the mediation get started guides (Android | iOS).

If you have any questions about rewarded video mediation, you can reach us on our forum. You can also find us on Google+, where we have updates on all of our Google Ads developer products.