Wednesday, November 13, 2019

Introducing adaptive anchor banners

In today’s mobile-first world, app publishers who use banner ads must serve them across a greater variety of screen sizes and layouts than ever before. Existing responsive banner ad formats often produce ads that are too small and not optimally tailored to the specifications of each device.

To address this, we’ve created a new banner type called adaptive anchor banners. These banners dynamically adjust creative size to deliver an ad that is ideally sized across all of your user’s devices, without the need to write any custom code.

These banners are designed to replace standard 320x50 and leaderboard banner sizes, as well as smart banners. Here is a comparison of the 3 formats on a standard mobile device:

Standard banner vs. smart banner vs. AdMob’s adaptive anchor banner


Migrating your banner implementation to adaptive

Here are a few simple steps to update your banner implementation to use adaptive banners:

  1. Ensure your UI supports a variable height banner. Depending on what constraints or layout mechanism you are using to position your banner, you may need to remove height constraints such that the layout accepts variable content size.
    • For Android this can be done using WRAP_CONTENT.
    • For iOS constrain your banner in terms of X and Y positions, you may also give it a width constraint, but ensure any height constraint or content size is placeholder only.

    Note that the max height is 15% of the device height or 90px, whichever is smaller.

  2. Use the adaptive banner ad size APIs to get an adaptive ad size. The adaptive ad size APIs are available for different orientations.

    Android:
    AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(context, width)
    AdSize.getPortraitAnchoredAdaptiveBannerAdSize(context, width)
    AdSize.getLandscapeAnchoredAdaptiveBannerAdSize(context, width)

    iOS:
    GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(width)
    GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth(width)
    GADLandscapeAnchoredAdaptiveBannerAdSizeWithWidth(width)

    Unity:
    AdSize.GetCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(width)
    AdSize.GetPortraitAnchoredAdaptiveBannerAdSizeWithWidth(width)
    AdSize.GetLandscapeAnchoredAdaptiveBannerAdSizeWithWidth(width)

    Which one you use depends on your use case. If you want to preload ads for a given orientation, use the API for that orientation. If you only need a banner for the current orientation of the device, use the current orientation API.

    Once you have an ad size, set that on your banner view as usual before loading an ad. The banner will resize to the adaptive ad size as long as you have laid it out without any conflicting constraints.

  3. Update your mediation adapters. If you use mediation, update your mediation adapters to the latest version. All open source mediation adapters that support banners have been updated to support the adaptive banner ad size requests. Note that adapters will still only return ad sizes supported by their corresponding ad network SDK, and those ads will be centered in your adaptive banner view.

Review our developer resources

For further information including detailed implementation guidance, review our developer resources:

As always, please reach out on our developer forum if you have any questions.