Unity Banner ads not show real ads

Hello,

Unity Banner ads only work in test mode, and does not deliver real ads. Is there an issue with the banner ads? Or there are simply no real banner ads to display yet?

Also, does Unity Banner ads works with Google Advertising?
https://blogs.unity3d.com/2018/08/07/unity-releases-google-advertising-for-developers/

1 Like

Hello Dreeka,
can you see an error message on your device logs?

Also, can you share on which platform you are experiencing this and snippets on initialisation and showing the banner ads?

Best regards,

Jussi Kuosa (Unity Ads QA)

Hey,

I see no error. I use the following code for init:

 if (Application.platform == RuntimePlatform.Android)
                Monetization.Initialize(platformData.androidGameId, platformData.unityTestMode);
            else if (Application.platform == RuntimePlatform.IPhonePlayer)
                Monetization.Initialize(platformData.appleGameId, platformData.unityTestMode);
          
            if (adsEnabled)
            {
                Advertisement.Banner.Load(platformData.bannerAdId);
            }

and then I call the following function:

public static void ShowUnityBannerAd()
        {
            if (adsEnabled)
            {
                Advertisement.Banner.Show(platformData.bannerAdId);
            }
        }

I am trying on an Android device (LG G4). platformData.bannerAdId and platformData.androidGameId has the correct id’s, and adsEnabled is set to true.

Also, there is another issue. If I call ShowUnityBannerAd function at start, the banner does not appear. But if I call it 4 seconds after start, it appears.

Also, does Unity Banner ads shows AdMob ads as well, or only Unity specific banner ads?

Hello Dreeka, shouldn’t it be

Advertisement.Initialize(platformData.androidGameId, platformData.unityTestMode);
instead of
Monetization.Initialize(platformData.androidGameId, platformData.unityTestMode);
?

You can add options to Advertisement.Banner.Load to get a callback when load has succeeded or failed :

    public void LoadBanner()
    {
        BannerLoadOptions options = new BannerLoadOptions { loadCallback = OnLoadBannerSuccess, errorCallback = OnLoadBannerFail };
        Advertisement.Banner.Load(bannerPlacementId, options);
    }

    private void OnLoadBannerSuccess()
    {
        Debug.Log("OnLoadBannerSuccess");
        BannerOptions options = new BannerOptions { showCallback = OnShowBanner, hideCallback = OnHideBanner };
        Advertisement.Banner.Show(bannerPlacementId, options);
    }

    private void OnLoadBannerFail(string message)
    {
        Debug.LogError("OnLoadBannerFail reason : " + message);
        //retry to show banner maybe if the reason was that the placement was not ready
    }

That way you can see if there is an error during the loading of the Banner and show it only when it’s loaded.

Hope it helps you !

Edit:
For me the banners show in non-test mode only when I set the “override client test mode” to “Force test mode OFF (i.e. use production ads) for all devices” in the plateform settings on https://operate.dashboard.unity3d.com/ → Monetization → Plateforms → Google Play Store/ Apple App Store → Settings

Edit 2:
In fact it as worked for a few minutes but now I just get the error : “Banner placement ‘horizontalBanner’ is not ready”

1 Like

I have tried the following code:

Debug.Log("Init ads");
Advertisement.Initialize(platformData.androidGameId, platformData.unityTestMode);

BannerLoadOptions options = new BannerLoadOptions();

options.errorCallback += ((string message) => {
    Debug.Log("Error: " + message);
});

options.loadCallback += (() => {
    Debug.Log("Ad Loaded");
});

Advertisement.Banner.Load(platformData.bannerAdId, options);

And when I run on my device, I get the following messages:
Init ads
Error: UnityAds is not initialised.

Update:
If I try the following code:

Debug.Log("Init ads");
Advertisement.Initialize(platformData.androidGameId, platformData.unityTestMode);
StartCoroutine("ShowBannerWithDelay");

public static void Show()
{
    BannerLoadOptions options = new BannerLoadOptions();

    options.errorCallback += ((string message) => {
        Debug.Log("Error: " + message);
    });

    options.loadCallback += (() => {
        Debug.Log("Ad Loaded");
    });

    Debug.Log("Loading banner ad");
    Advertisement.Banner.Load(platformData.bannerAdId, options);
}

IEnumerator ShowBannerWithDelay()
{
    Debug.Log("Enter: ShowBannerWithDelay");

    yield return new WaitForSeconds(2.5f);
    Show();
}

Then I get the following output:
Init ads
Enter: ShowBannerWithDelay
Loading banner ad

And no callback is called. Is the SDK broken? It only works in test mode.

@Dreeka , @CloudDeLuna

We are aware of 3 issues with Banners at the moment:

  1. Our documentation could be a bit clearer around checking the placement status and using callbacks. The examples in this thread are more comprehensive and we’ll get our docs updated as soon as we can.
  2. Banners are not currently supported for players in the EU. We are still finalizing our GDPR solution for banners.
  3. Since this is a new feature for us, there isn’t a ton of banner ad inventory at the moment. We expect fill for banner ads to ramp up over time.
2 Likes

Hi,

In this situation the device logs probably show a warning. I recommend calling the banners only when there’s a signal for availability.

This is worth to note currently however: banner delivery will start a bit later in Europe due to some kinks our team needs to work out.

Thank you for your patience while we roll out new ad formats to our service.

2 Likes

Hi! i want to know that how can i change the position of banner?

Hi! i want to know that how can i change the position of banner?

1 Like

When I try to show a banner I get the follow message:

W/UnityAds: +[USRVApiSdk WebViewExposed_logWarning:callback:] (line:53) :: Could not show banner due to No fill for placement banner

I’m not sure of the reason. Is it because in Europe the banners are not yet available?

Thanks!

1 Like

If you are in Europe, then that is likely the reason.

Otherwise, there may be times where a banner ad is not available, even if you implemented your code correctly. There is an expected ramp up period, but Unity is working toward fulfilling a majority of ad requests.

Thanks for the confirmation!

Is there some sort of test banner ad that should be coming up when initializing in this way:

Advertisement.Initialize(“0000000”, true);

I’ve release my game last week and just discover this issue with Europe.
Have you any date to communicate about when this will be fix?

Thanks.

2 Likes

i have an issue with unity banner ads not shown when test mode false . onUnityBannerErrors i receive a message “Banner placement is not ready”
i’m using android studio for showing banner test is working perfect.
for implementation i follow the unity3d official documentation.
https://unityads.unity3d.com/help/android/integration-guide-android

@mudi_256

Banners are now available in all regions, depending on our available inventory. We’re currently working with our demand partners to ensure Unity developers are able to receive bids and impressions. There is an expected ramp up period but Unity is working toward fulfilling a majority of ad requests.

@ap-unity

  1. I have the same problem.
    I do not see real ads.
// always return FALSE!!
Debug.Log(Advertisement.IsReady(myPlacement));

And it does not depend on the callbacks (LoadCallback and ErrorCallback).
Sometimes it is: “OnLoadBannerSuccess”
And sometimes it is: “OnLoadBannerFail reason: Banner placement Small_Banners is not ready.”

But Advertisement.IsReady(…) is always FALSE.

  1. Additional question.
    Why did you implement the “Load()” method? :slight_smile:
    It is not used in your example:
    void Start () {
        Advertisement.Initialize (gameID, testMode);
        StartCoroutine (ShowBannerWhenReady ());
    }

    IEnumerator ShowBannerWhenReady () {
        while (!Advertisement.IsReady ("banner")) {
            yield return new WaitForSeconds (0.5f);
        }
        Advertisement.Banner.Show (bannerPlacement);
    }

Thanks!

@ap-unity

I’m also failing to get live banner ads showing (works fine in the editor, I see the dummy banner). This is the code I’m using:-

using System.Collections;
using UnityEngine;
using UnityEngine.Advertisements;

[RequireComponent(typeof(MonetizationManager))]
public class UnityBannerAd : MonoBehaviour
{
    public string bannerPlacement = "banner";

    void Start()
    {
        Advertisement.Initialize(MonetizationManager.Instance.gameId, MonetizationManager.Instance.testMode);
        Debug.Log($"Advertisement.isInitialized {Advertisement.isInitialized}");

        StartCoroutine(ShowBannerWhenReady());
    }

    IEnumerator ShowBannerWhenReady()
    {
        Debug.Log($"Waiting for banner {bannerPlacement}");
        while (!Advertisement.IsReady(bannerPlacement))
        {
            yield return new WaitForSeconds(0.5f);
        }
        Debug.Log("Banner ready");
        Advertisement.Banner.Show(bannerPlacement);
    }
}

I see the log entry ‘Banner ready’, so the system thinks it’s good to go, but the banner never shows. So I’m not sure if this means there is no ad available to fulfil the request, or if it’s something else.

I be grateful for some advice on whether it’s just a case of waiting a bit longer for the banner format to get up to speed or if I’m missing something.

I should say that the video ads are working fine.

1 Like

Update to my previous post. Logcat shows that the banner can’t be shown because there is no fill available for it.

Shame, because I was looking forward to comparing the RPM with what I get from AdMob.

Same happens for me, Could not show banner due to No fill for placement…