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 Only Showing Test ADs not the Real ads

Discussion in 'Unity Ads & User Acquisition' started by NINADHAJARE, May 2, 2020.

  1. NINADHAJARE

    NINADHAJARE

    Joined:
    Jul 5, 2017
    Posts:
    2
    Hey EveryOne....I have a problem with Unity Ads Test ads are Working Fine in my apk but Real Ads are not Showing...i tried all the things shown in the forums....In my apk built i only see unity test ads.
    Settings i have done :
    1. In the Dashboard my "Override Client Test Mode" to "ON"
    2. The radio button for "Force test mode OFF (i.e. use production ads) for all devices"
    First i have this Force test mode On for testing ads on my device but when i turn it Off once i have seen real add in my apk but after that Force Test Mode is being off i have not showing my real ads only unity test ads are showing.
    3.In unity Services tab, Test mode Enabled i tried both enabling and disabling this check box nothing happens.
    What should i do Please suggest anyone i have search for this at many places....

    Note :Both the playstore and apple IDS i have written Right

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

    public class UnityADs : MonoBehaviour
    {
    public static UnityADs Instance;
    private string playstoreid = "XXXXXXX";
    private string appleid = "XXXXXXX";

    private string InsterstialAd = "video";
    private string RewardedAd = "rewardedVideo";
    private string BannerAd = "banner";

    public bool isTargetedPlayStore;
    public bool isTestAds;
    // Start is called before the first frame update
    void Start()
    {
    Instance = this;
    InitialiseAdvertisement();
    StartCoroutine(ShowBannerWhenReady());
    }

    // Update is called once per frame
    public void InitialiseAdvertisement()
    {
    if (isTargetedPlayStore) { Advertisement.Initialize(playstoreid, isTestAds);return; }
    Advertisement.Initialize(appleid , isTestAds);

    }
    public void adshower()
    {
    if (!Advertisement.IsReady(InsterstialAd)) { return; }
    Advertisement.Show(InsterstialAd);

    }

    IEnumerator ShowBannerWhenReady()
    {
    while (!Advertisement.IsReady(BannerAd))
    {
    yield return new WaitForSeconds(0.5f);
    }
    Advertisement.Banner.SetPosition(BannerPosition.BOTTOM_CENTER);
    Advertisement.Banner.Show(BannerAd);
    }
    }



    Please Help me in this Matter
     
  2. kyle-unity

    kyle-unity

    Unity Technologies

    Joined:
    Jan 6, 2020
    Posts:
    336
    @NINADHAJARE I just responded to you in another thread but I'll put it here as well :)

    Check your UnityADs object in the Unity Editor. It could be your "isTestAds" public variable is still set to true. You may also have your device registered as a test device on the dashboard - if this is the case then that device will always receive test ads, regardless of any other settings.
     
  3. Talha113

    Talha113

    Joined:
    Apr 10, 2019
    Posts:
    8
    Hey, @NINADHAJARE is your issue resolved? I'm also having the same issue, don't know how to resolve it.
     
  4. Unity_Adamski

    Unity_Adamski

    Unity Technologies

    Joined:
    Jul 20, 2020
    Posts:
    110
    @Talha113

    Sadly this is a very common mistake. There are two different ways you can disable testMode in your application.
    The first method will require you to do another build, to do this you must locate the testMode toggle in the services window and disable it, then you must pass through the false boolean for testMode in your Advertisement.Intitialize() function. Also if your testMode variable is a public variable, or serializable, ensure that it is also set to false in the inspector panel.
    The second method will not require you to do a new build however it will disable testMode regardless of what boolean you pass to the SDK. To do this you will need to go to your project in your Unity Dashboard > Project Settings > TestMode, set this to 'Override Client Test Mode' and then 'Force Test Mode OFF'. This will force testMode off on all builds of your app regardless of the settings in your code.
    I hope this helps, if you need anything else please let me know.
     
  5. Talha113

    Talha113

    Joined:
    Apr 10, 2019
    Posts:
    8
    I have done exactly what you have said. The real ads sometimes run on android devices but sometimes they don't
    My games are
    https://play.google.com/store/apps/details?id=com.FlashGamesStudios.DumbRunners
    https://play.google.com/store/apps/details?id=com.FlashGameStudios.BreakofZombies
     
    Last edited: May 28, 2021