Inline adaptive banners
Stay organized with collections
Save and categorize content based on your preferences.
Page Summary
Inline adaptive banners allow you to specify a width to determine the optimal ad size and maximize performance by optimizing for each device.
Compared to anchored adaptive banners, inline adaptive banners are larger, taller, have variable heights, and are placed in scrolling content.
To implement inline adaptive banners, you obtain the device width (or set a custom width) and use a static method on the ad size class to create an inline adaptive ad size object.
You can limit the height of inline adaptive banners by using the AdSize.getInlineAdaptiveBannerAdSize(int width, int maxHeight) method.
Adaptive banners let you specify the width of an ad to determine the optimal
ad size. Adaptive banners also maximize performance by optimizing the ad size
for each device. This approach results in opportunities for
improved performance.
Compared to anchored adaptive banners, inline adaptive banners are larger,
taller, and use variable instead of fixed heights. Inline adaptive banners are
of variable height, and might encompass the entire screen or a maximum height
that you specify.
You place inline adaptive banners in scrolling content, for example:
Before you begin
Before continuing, make sure you have completed the getting started guide,
Banner ads.
Implement adaptive banners
Unlike anchored adaptive banners, inline adapter banners load using an inline
adaptive banner size. To create an inline adaptive ad size, complete the
following:
Get the width of the device in use, or set your own width if you don't want
to use the full width of the screen.
When implementing adaptive banners in your app, note these points:
The inline adaptive banner sizes work best when using the full available
width. In most cases, this size is the full width of the device screen in
use, or the full width of the banner's parent content. You must know the width
of the view to place in the ad, the device width, the parent content width,
and applicable safe areas.
You may need to update or create new line items to work with adaptive
sizes. Learn more.
Orient inline adaptive banner size
To preload an inline adaptive banner ad for a specific orientation, use the
following methods:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-12-05 UTC."],[],["Inline adaptive banners, which are larger and use variable heights compared to anchored banners, optimize ad size for each device and enhance performance. Implementation involves determining ad width, using methods like `AdSize.getCurrentOrientationInlineAdaptiveBannerAdSize` or `AdSize.getInlineAdaptiveBannerAdSize` to get an ad size object, setting the size with `setAdSizes`, and loading the ad with `loadAd`. They can be preloaded for specific orientations or have height limitations using the `maxHeight` parameter. These banners work best at full width and require setting the right width and height.\n"]]