Skip to main content

Banner Ads

Banner ad units display rectangular ads that occupy a portion of an app's layout. They can refresh automatically after a set period. This means users will view a new ad regularly, even if they stay on the same screen in your app. They're also the simplest ad format to implement.

Benefits of Banner Ads

  • Banner Ads are among the oldest advertisements and can make instant impressions at a relatively low cost.
  • Banner Ads offer a quick, easy, and cost-effective way to generate immediate interest.
  • Banner Ads can pique viewers' curiosity and help retain them by promoting brand awareness.

Supported size

SIZEDESCRIPTIONAVAILABILITYADSIZE CONSTANT
320×50Standard BannerPhones and TabletsBanner
320×100Large BannerPhones and TabletsLargeBanner
300×250IAB Medium RectanglePhones and TabletsIABMediumRectangle
Full-screen width x
Adaptive height
Adaptive bannerPhones and TabletsAdaptiveBanner
Screen width x
32/50/90
Smart bannerPhones and TabletsSmartBanner
caution

You should finish these steps before releasing.

Load and Display the ad

You can show the ad using this code, but we recommend using the ad events as you’ll be able to show the ad once it’s loaded. You can check the full script provided below.

Yodo1U3dBannerAdView bannerAdView = new Yodo1U3dBannerAdView(Yodo1U3dBannerAdSize.Banner, Yodo1U3dBannerAdPosition.BannerBottom | Yodo1U3dBannerAdPosition.BannerHorizontalCenter);
bannerAdView.LoadAd();
bannerAdView.Show();

Configure the ad events

The MAS SDK fires several events to inform you of ad availability.

using Yodo1.MAS;

public class BannerAdLoader : MonoBehaviour
{
Yodo1U3dBannerAdView bannerAdView = null;
private void Start()
{
bannerAdView = new Yodo1U3dBannerAdView(Yodo1U3dBannerAdSize.Banner, Yodo1U3dBannerAdPosition.BannerBottom | Yodo1U3dBannerAdPosition.BannerHorizontalCenter);
SetupEventCallbacks();
LoadBannerAd();
}

private void SetupEventCallbacks()
{
bannerAdView.OnAdLoadedEvent += OnBannerAdLoadedEvent;
bannerAdView.OnAdFailedToLoadEvent += OnBannerAdLoadFailedEvent;
bannerAdView.OnAdOpenedEvent += OnBannerAdOpenedEvent;
bannerAdView.OnAdFailedToOpenEvent += OnBannerAdOpenFailedEvent;
bannerAdView.OnAdClosedEvent += OnBannerAdClosedEvent;
}

private void LoadBannerAd()
{
bannerAdView.SetAdPlacement("Your placement id");
bannerAdView.LoadAd();
}

private void OnBannerAdLoadedEvent(Yodo1U3dBannerAdView ad)
{
// Code to be executed when an ad finishes loading.
}

private void OnBannerAdLoadFailedEvent(Yodo1U3dBannerAdView ad, Yodo1U3dAdError adError)
{
// Code to be executed when an ad request fails.
}

private void OnBannerAdOpenedEvent(Yodo1U3dBannerAdView ad)
{
// Code to be executed when an ad opened
}

private void OnBannerAdOpenFailedEvent(Yodo1U3dBannerAdView ad, Yodo1U3dAdError adError)
{
// Code to be executed when an ad open fails.
}

private void OnBannerAdClosedEvent(Yodo1U3dBannerAdView ad)
{
// Code to be executed when the ad closed
}
}

Video Tutorial