Add Smart Banner for apps
The Smart Banner size for ad units allows publishers to display the best sized ad according to the size and orientation of their mobile app. With Smart Banners, developers don’t need to offer a fixed size for their ad unit; they simply specify that the ad unit fill the width of the screen. This gives developers more flexibility in creating ad spaces within their apps that fit with a variety of screen sizes.
Smart Banners are only supported for standard banner calls and Mediation. Use of Smart Banners with other features, such as Native ads and Ad Exchange Flexible sizes, is not supported. The Smart Banner ad unit size doesn't work with interstitials.
The Google Mobile Ads SDK has native support for Smart Banners and will fill the creative according to the following:
- If the ads are coming directly from Google Ad Manager, any extra width in the banner view will be transparent.
- If the ads are backfilled from Ad Exchange, gray tiling will be added to the creative as necessary to fill the entire width of the banner view. For example, if the ad view is 360x50, a 320x50 creative will be padded with 20px wide gray tiling on the left and right.
Read the following to learn how to create Smart Banner ad units, how the ad height is determined, how Smart Banners work with backfill, and more.
Create an ad unit with the Smart Banner size
Follow these steps:
- Create an ad unit as you normally would and select Smart Banner from the “Size mode” drop-down.
- In the app, use one of the following ad sizes for the ad view:
The Google Ad Manager tag generator only creates mobile app ad tags for Smart Banner ad units because they're for apps only.
- Google Ad Manager matches all line items that fit both of the following:
- Have a height equal to the requested height.
- Have a width that fits into this equation:
(requested width / 2) <= creative width <= requested width
For example, creatives sized between 180x50 to 360x50 would be eligible to serve to a 360x50 Smart Banner request.
The height of your ad is based on your device's height, as the following table indicates:
|Device height||Ad height|
|h < 400 dp||32 dp|
|400 dp <= h < 720 dp||50 dp|
|h >= 720 dp||90 dp|
Height is dependent on the device’s current orientation. In general, you'll see:
- 50 dp height on portrait phones.
- 32 dp height on landscape phones.
- 90 dp height on 10-inch tablets and iPads in both orientations.
- 90 dp height on portrait for most Android 7-inch tablets.
- 50 dp height on landscape for most Android 7-inch tablets.
Backfill for Smart Banners
Ad Exchange line items can target Smart Banner size ad units. The line items should be defined with fixed sizes that Ad Exchange supports (e.g., 320x50).
Smart Banners don’t support ad unit-level backfill for AdSense. This type of backfill requires a fixed size ad unit, so it doesn’t work with Smart Banners. Instead, you can use line item backfill for AdSense / Ad Exchange to target a Smart Banner-sized ad unit. Choose one or more fixed sizes on the line item to define the set of eligible creatives that may be served to the Smart Banner ad unit.
For example, if you set up an ad unit with the Smart Banner size and target it with an Ad Exchange line item with fixed size 320x50, only requests made to that ad unit from devices with height between 400 dp and 720 dp will be eligible to be backfilled with 320x50 ads. When the SDK renders a backfilled 320x50 ad, it will fill the gap between the 320 dp creative and the remaining unfilled banner view space (if any).
Below are solutions to issues that can arise while using smart banners.
Smart Banner ads are not delivering
Verify that there are active line items that are eligible to serve, and that your developer has correctly implemented the AdSize.SMART_BANNER size using the Google Mobile Ads SDK. You can verify this by ensuring the smart_w and smart_h parameters are included in the ad request.
When Smart Banner is enabled for a particular ad slot, the SDK will automatically detect the size of the mobile device and include that size in the ad request. All line items and creatives with the following sizes will become eligible to serve:
- Have a height matching the requested height.
- Have a width greater than or equal to half the requested width and less than or equal to the requested width. For example, creatives sized between 180x50 to 360x50 would be eligible to serve to a 360x50 Smart Banner request.
Smart Banner ads are not centered
When an image ad doesn’t take up the entire allotted space for the banner, the image will be centered. If your ads do not center, verify that the creative’s true size matches the target size in Google Ad Manager. For example, if you configured a size override of 320x50 on a 360x50 creative, the SDK will render a 360x50 ad view to display the 320x50 creative. You should create a separate creative for each individual size.