Unity Fake ads work great in editor but not on android or even published

Testing my game in Editor, the ads work great right where they should be but when exported to my android phone and installed from google play no ads show. Ive tested on a Galaxy Note 8, Samsung S7, samsung s8. I did the Unity guide step by step. I have my script on a prefab called AdBox. I made sure that I pasted mygame ID(hoping it was a simple error). Just seem I cant figure this out. Is it possible Unity ADs take awhile with publishing? Thinking of every possible angle here lol
Here is my Script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Advertisements;
using UnityEngine.Monetization;

public class ADManager : MonoBehaviour
{
public static ADManager Instance { get; set; }

public string placementId = “video”;
public string bannerPlacement = “banner”;

public bool testMode = false;

#if UNITY_IOS
public const string gameId = “1234567”;
#elif UNITY_ANDROID
public const string gameID = “2926214”;
#elif UNITY_EDITOR
public const string gameID = “1111111”;
#endif

private void Start()
{
Monetization.Initialize(gameID, testMode);
Advertisement.Initialize(gameID, testMode);
Instance = this;
DontDestroyOnLoad(gameObject);
StartCoroutine(ShowBannerWhenReady());
}

IEnumerator ShowBannerWhenReady()
{
while (!Advertisement.IsReady(“banner”))
{
Debug.Log(“Banner not ready”);
yield return new WaitForSeconds(0.5f);
}
Debug.Log(“Showing Banner”);
Advertisement.Banner.Show(bannerPlacement);
}

public void ShowDefaultAd()
{
#if UNITY_ADS
if (!Advertisement.IsReady())
{
Debug.Log(“Ads not ready for default placement”);
return;
}

Advertisement.Show();
#endif
}

public void ShowAd()
{
StartCoroutine(ShowAdWhenReady());
}

public IEnumerator ShowAdWhenReady()
{
while (!Monetization.IsReady(placementId))
{
Debug.Log(“Default ad not ready”);
yield return new WaitForSeconds(0.25f);
}

ShowAdPlacementContent ad = null;
ad = Monetization.GetPlacementContent(placementId) as ShowAdPlacementContent;

if (ad != null)
{
Debug.Log(“Showing Default ad”);
ad.Show();
}
}

}

Please provide the device logs. On Android, your Debug.Log statements will be included How To - Capturing Device Logs on Android On a side note, please use code tags. Look for the Code: button in the ribbon bar above

I’m having the same issue. Was this problem resolved?

What do your device logs show? I trust that you are using the correct gameID, and @snowwolfam24 make sure your code snippet above is not displaying your real gameID (for privacy/security)

Does this log help? I’ve double checked the Game ID for Google Play Store and it matches my script. I otherwise copied the Implementing Banner ads guide script and it works in the editor but not on any device so far.

I’ve done video adds on a previous app and that worked fine. Maybe there is something else that I’m missing because I’m trying to use banner ads.

3969118–340621–log.txt (14.7 KB)

Currently banner ads work in the US and we are rolling out to other countries. In your logs however I don’t see anywhere where you are initializing ads. Please place Debug.Log statements in the relevant portions in your app, which will then show in the logs.

This log has more info. Look for things related to SantaNeedsYourHelp. The device has Feet_and_Inches_Calc on it which runs video ads that are working.

I noticed a warning that says “Could not show banner due to No fill for placement banner.” Does this mean that there is no ad available to show?

This is how I placed Debug.Log statements:

void Start()
    {
        Debug.Log("In the Start method for UnityAds script");
        Advertisement.Initialize(gameID, testMode);
        StartCoroutine(ShowBannerWhenReady());
    }

    IEnumerator ShowBannerWhenReady()
    {
        Debug.Log("In the Coroutine for UnityAds script");
        while (!Advertisement.IsReady("banner"))
        {
            Debug.Log("In the While loop for UnityAds script");
            yield return new WaitForSeconds(0.5f);
        }
        Debug.Log("After the While loop for UnityAds script");
        Advertisement.Banner.Show(bannerPlacement);
    }

3969250–340648–log.txt (152 KB)

“Initializing Unity Ads 2.1.1 (2101) with game id ***** in test mode” You should be using the Monetization SDK 3.0 available on the Asset Store, and you are using test mode. Unity developer integration guides

I downloaded “Unity Monetization 3.0” from the asset store when I started this project. If I try to download again, it says “Nothing to import!”

I’ve been toggling back and forth on Production and Test Mode trying to get something to work. If in test mode, will I see a gray box that says “This would be your banner” on the android device?

There are two apps on that device so the older app may be using 2.1.1. See this line from the log:
12-06 15:51:15.450 19055 19074 I UnityAds: com.unity3d.services.UnityServices.initialize() (line:79) :: Initializing Unity Services 3.0.0 (3000) with game id #####29 in production mode

It worked for the first time today, but only once. It looks like there just aren’t ads available to display. I’m in the US so I thought that wouldn’t be a problem.

Had the same issue, had to switch to another network. If you do end up getting this to work, please let us know

I’ve seen your posts on the forum. I think I’ll be switching to another platform, too.

I am by no means trying to make Unity lose customers, but if that’s what it takes to improve banner ads… lol
I am currently trying Facebook Audience Network, and StartApp.

I had a hell of a time trying to implement FAN banners, especially due to no customer support, and a low activity support group. Finally got it implemented, but my apps CPM is only like $0.30 at the moment… Hope that goes up as more people use it.

StartApp was super easy to implement, but after 80 impressions, and 10 clicks at 100% fill rate, there was $0 earnings, not sure if that aswell would go up within time or not, but either way, I will stay with FAN for a month and see if it’s worth it.

Really hoping Unity banner ads improve soon.

Yeah, similar issue here with 2018.3. Unity banner ads show as intended in the editor. It seems the banners do load eventually, so I assume the issue is with the ad server and not the implementation code. I really hope Unity prioritizes this issue. I know it’s early for Unity’s banner implementation, so maybe they don’t have enough advertisers, but the same activity is identical for test ads. Can take anywhere from 1 second to multiple minutes before the banner shows if it even does at all, and by then, the players have already moved on to the next screen. It’s wildly inconsistent on the load times when the entire point of a banner ad is to serve it quickly. Thanks for the recommendations on other services.

Well the issue can be solved just go to your unity dashboard and select the game or project you published or publishing then go to Ads then placement where you can find in the ads option that ask for “forced to disable test ads” click yes then no Test Ads will be going to show on your game or app Unity will show the real Ads to your customer. Hope this will help you.

Hi, are you happy with FAN?

I’m trying with this unity ads, it works in editor but no working on android devices, (for these days that type of errors should be solved) On the other hand Admob support suks, so simple, I want to try with FAN

Hey , I’m having the same issue
ONLY IN BANNER ADS (video is working)
so this is my code , also the device unity log
so what should I do ?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Monetization;
public class UnityAdManger : MonoBehaviour
{
    public static UnityAdManger Instance;

    private string storeID = "******";
    private string bannerAd = "Banner";
    private string videoAd = "video";
    private string rewardedVideoAd = "rewardedVideo";

    private void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
            DontDestroyOnLoad(Instance);
        }
        else
        {
            Destroy(gameObject);
        }
        Monetization.Initialize(storeID,true);
    }
    void Start()
    {
        RequestBannerUnityAd();
    }

    // Update is called once per frame
    void Update()
    {
        RequestBannerUnityAd();
    }
    public void RequestBannerUnityAd()
    {
        print("Requested baner ad");
        if (Monetization.IsReady(bannerAd))
        {
            print("banner ad is ready");
            ShowAdPlacementContent ad;
            ad = Monetization.GetPlacementContent(bannerAd) as ShowAdPlacementContent;
            if (ad != null)
            {
                print("showing banner ad");
                ad.Show();
            }
        }
    }
    public void RequestUnityVideoAd()
    {
        print("Requested video ad");
        if (Monetization.IsReady(videoAd))
        {
            print("video ad is ready");
            ShowAdPlacementContent ad;
            ad = Monetization.GetPlacementContent(videoAd) as ShowAdPlacementContent;
            if(ad != null)
            {
                print("showing video ad");
                ad.Show();
            }
        }
    }
    public void RequestUnityRewardedVideoAd()
    {
        if (Monetization.IsReady(rewardedVideoAd))
        {
            ShowAdPlacementContent ad;
            ad = Monetization.GetPlacementContent(rewardedVideoAd) as ShowAdPlacementContent;
            if (ad != null)
            {
                ad.Show();
            }
        }
    }
}


Same issue here. There’s always an issue with Unity of late.

2 Likes

Hi there!
Same issue: video ads work ok, banner ad not shown on android at least in Greece and Russia.
You may try it here - https://play.google.com/store/apps/details?id=com.Omega486GameStudio.DeepSpaceRescue1 - banner should start from main menu scene

Is banner option still in development or available inside US only?

1 Like