Banner & MREC Ads

Loading a Banner or MREC

To load a banner or MREC, call CreateBanner() or CreateMRec(), passing it your Ad Unit ID and desired ad view 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("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);
    }
  • Ad Unit Identifier. Create MRec: Ad Unit Identifier, MRec Position (Centered).
  • const FString MRecAdUnitId = TEXT("ad_unit_ID");
    
    void InitializeMRecAds()
    {
        // MRECs are sized to 300x250 on phones and tablets
        // You may use the utility method 'UAppLovinMAX::IsTablet()' to help with view sizing adjustments
        UAppLovinMAX::CreateMRec(MRecAdUnitId, EAdViewPosition::Centered);
    }

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 or MREC

Show a banner or MREC with the following call:

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

Hiding a Banner or MREC

Hide a banner or MREC with the following call:

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