Banner Ads

Loading a Banner

To load a banner, call CreateBanner(), passing it your Ad Unit ID and desired banner position:

  • Banners are automatically sized to 320×50 on phones and 728×90 on tablets. You may call the utility method “Is Tablet” to help with view sizing adjustments: Ad Unit Identifier. Create Banner: Ad Unit Identifier. Banner Position: Bottom Center. Set background or background color for banners to be fully functional. Set Banner Background Color: Ad Unit Identifier, Color. Make Color. B:0, G:0, R:0, A:0; Color.
  • const FString BannerAdUnitId = TEXT("banner_ad_unit_ID");
    
    void InitializeBannerAds()
    {
        // Banners are automatically sized to 320×50 on phones and 728×90 on tablets
        // You may call the utility method UAppLovinMAX::IsTablet() to help with view sizing adjustments
        UAppLovinMAX::CreateBanner(BannerAdUnitId, EAdViewPosition::BottomCenter);
        
        // Set background or background color for banners to be fully functional
        UAppLovinMAX::SetBannerBackgroundColor(BannerAdUnitId, banner_background_color);
    }

The above example creates a banner at the bottom-center of the display (BottomCenter). The complete list of position options are:

  • TopLeft
  • TopCenter
  • TopRight
  • Centered
  • CenterLeft
  • CenterRight
  • BottomLeft
  • BottomCenter
  • BottomRight

Set your banner background color to any FColor, for example FColor:Black or FColor:FromHex("#fff200") (yellow).

Showing a Banner

To show a banner, call ShowBanner():

  • Ad Unit Identifier. Show Banner: Ad Unit Identifier.
  • UAppLovinMAX::ShowBanner(ad_unit_ID);

Hiding a Banner

To hide a banner, call HideBanner():

  • Ad Unit Identifier. Hide Banner: Ad Unit Identifier.
  • UAppLovinMAX::HideBanner(ad_unit_ID);