Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Unity ads banner not working on Android

Discussion in 'Unity Ads & User Acquisition' started by fluks, Aug 19, 2021.

  1. fluks

    fluks

    Joined:
    Aug 10, 2021
    Posts:
    7
    This seems to be very common problem. The test banner is visible in editor.

    Code (CSharp):
    1. using System.Collections;
    2. using UnityEngine;
    3. using UnityEngine.Advertisements;
    4.  
    5. public class AdManager : MonoBehaviour
    6. {
    7.     private string gameId = "4063985";
    8.     private bool testMode = true;
    9.     private string surfacingId = "bannerPlacement";
    10.  
    11.     void Start()
    12.     {
    13.         //if (Application.platform == RuntimePlatform.Android)
    14.         //{
    15.             Advertisement.Initialize(gameId, testMode);
    16.             StartCoroutine(ShowBannerWhenInitialized());
    17.         //}
    18.        
    19.     }
    20.  
    21.     IEnumerator ShowBannerWhenInitialized()
    22.     {
    23.         while (!Advertisement.isInitialized)
    24.         {
    25.             yield return new WaitForSeconds(0.5f);
    26.         }
    27.         Advertisement.Banner.SetPosition(BannerPosition.BOTTOM_CENTER);
    28.         Advertisement.Banner.Show(surfacingId);
    29.     }
    30. }
    31.  
    I'm building in Unity 2020.2.5f1.4029.
    Ads version is 3.7.5.

    Logcat:
     
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @fluks

    I would recommend using the example scripts in our documentation as a starting point, since they will allow you to log any errors that happen when you load or show a banner:
    https://unityads.unity3d.com/help/unity/integration-guide-unity#banner-ads

    In general, if you see the test banners in Test Mode, then your integration is likely correct. The most common cause of not getting banner ads is lack of available banner demand. This would be expressed as "No fill for placement" errors.

    Many of our banner advertisers will only bid into games that have implemented the app-ads.txt file correctly. This file is a standard that has been developed over the last few years to combat fraud and create transparency in the advertising market. More info can be found in our documentation:
    https://unityads.unity3d.com/help/resources/app-ads-txt-support

    However, even with app-ads.txt implemented, the availability of banners will vary greatly by region. We continue to ramp up banner demand, but a lot of that improvement has been focused in specific regions, so not all countries are seeing banners available.

    If banners represent a major issue for you, I would recommend investigating other options. Unity Ads is supported in all of the top mediation platforms, and many do have support for our banner ads:
    https://unityads.unity3d.com/help/resources/mediation
     
  3. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    437
  4. fluks

    fluks

    Joined:
    Aug 10, 2021
    Posts:
    7
    I don't get this kind of an error.

    I implemented the app-ads.txt now, but I still don't get a banned ad. It's here: https://reaktori.xyz/app-ads.txt

    I'm in Finland.

    If you have time, you can test my game if you can see ads. It should be available from this link from Play store. I also disabled test mode.

    https://play.google.com/apps/internaltest/4698768785263056346
     
  5. Eozgungor

    Eozgungor

    Joined:
    Jun 10, 2022
    Posts:
    4
    Did you solve it? It still does not showing in my game.
     
  6. burak11581999

    burak11581999

    Joined:
    May 4, 2020
    Posts:
    4
    I think problem is related to Unity Ads itself. There is nothing to show banner ad in unity ads.