Banner and MREC ads are rectangular ad formats that occupy part of an app’s layout—often at the top or bottom of the screen or inline in scrollable content. They remain visible as users interact with the app, which allows uninterrupted gameplay or use, and can refresh automatically after a set period.
The following sections show you how to load, show, and hide a banner or MREC ad.
The following code shows you how to load a banner or MREC by using your Ad Unit ID, desired position, and (for banners) desired background color. MAX will size the ad for you automatically:
To show a banner or MREC, make the following call:
To hide a banner or MREC, make the following call:
Adaptive banners are responsive banners with heights that derive from the device type and the width of the banner.
To disable adaptive banners, set the adaptive_banner flag, as in this example:
Call AppLovinMAX.get_adaptive_banner_height(«width») to get the banner height, and then adjust your content accordingly.
You may want to stop auto-refresh for an ad. This may be the case when you hide an ad or you want to manually refresh. Stop auto-refresh with the following call:
Start auto-refresh for an ad with the following call:
“Why mobile banners ads persist in a video and playable world” from AppLovin’s Blog.
Google bidding and Google AdMob, Google Ad Manager, Liftoff Monetize, Pangle, and Yandex support adaptive banners. MAX sizes banners from other networks in the non-adaptive way.
Google recommends that developers include a 50 px padding between the banner placement and the app content. This makes it less likely that users accidentally click the banner. Refer to Google’s “About Confirmed Click” policy for more information and best practices.