Banner Ad

1. Basic requirements

  • Add ​ADX Unity SDK to your project.

  • Use the Ad Unit ID issued for Banner Ads.

  • Before requesting an ad, SDK initialization must be done first.

    • SDK initialization should be called only once when the app launches and ad requests should be made after SDK initialization is complete.

2. Implementation

  1. If the app is distributed on both Android and iOS, enter the Ad Unit ID issued for each platform.

  2. Instantiate AdxBannerAd and register the required callbacks.

  3. Call Load() to load the ad.

#if UNITY_ANDROID
    string adxBannerAdUnitId = "<ANDROID_ADX_BANNER_AD_UNIT_ID>";
#elif UNITY_IOS
    string adxBannerAdUnitId = "<IOS_ADX_BANNER_AD_UNIT_ID>";
#endif

void LoadBannerAd()
{
    if (bannerAd != null)
    {
        bannerAd.Destroy();
        bannerAd = null;
    }

    bannerAd = new AdxBannerAd(adxBannerAdUnitId, AdxBannerAd.AD_SIZE_320x50, AdxBannerAd.POSITION_TOP);
    bannerAd.OnAdLoaded += BannerAd_OnAdLoaded;
    bannerAd.OnAdFailedToLoad += BannerAd_OnAdFailedToLoad;
    bannerAd.OnAdClicked += BannerAd_OnAdClicked;
    bannerAd.Load();
}

The following POSITION and AD_SIZE options are supported for banner ads.

3. Callback

You can receive specific events. Please implement them as needed.

4. Ad Revenue (OnPaidEvent)

You can check the estimated ad revenue for ad impressions.

circle-info

Last updated

Was this helpful?