Search Unity

Bug UnityAds Mediation not working and Impressions not being counted.

Discussion in 'Unity Ads & User Acquisition' started by ScuffedCD, May 7, 2023.

  1. ScuffedCD

    ScuffedCD

    Joined:
    Feb 4, 2020
    Posts:
    41
    (This was originally posted on Google AdMob forum but I figured I would post here as well, trying to get as much help as possible...)


    We recently switched from Unity LevelPlay to Google AdMob. This is our first time using mediation so we are fairly new to it.

    We're having some issues on our account.

    1. Our ad requests are exponentially higher than our impressions. While writing this our Requests are 573 while our impressions are 25. We don't show ads that often, but how can it be only 25 people have viewed the ads. We have 200+ downloads so far, and I myself have watched more than 25 ads. I've watched Interstitial multiple times this week, yet it says there is only 1 impression for this platform? Is Google just showing me ads and not counting it?

    2. We are using Mediation with AdMob and Unity Ads. AdMob has the highest priority with Unity Ad's order being $0.01. We have 4 ad units running (IOS Rewarded, IOS Interstitial, Android Rewarded, Android Interstitial). We have many errors here:
    - Both of the IOS ads have a "No Requests" error. The Android ads have a "Can't retrieve data" error. I've checked the implementation several times and am confident that we have the correct mappings.
    - Unity Dashboard states that these ad units haven't received impressions.
    Questions:
    1. Why are our impressions so low. I know for a fact that the numbers are wrong because I myself am watching more ads than what is shown. I imagine the number would be even higher considering other users as well.

    2. Is UnityAds displaying these errors simply because it hasn't been picked up by the mediation system? Is GoogleAds just scooping up every ad request before it can get to Unity Ads?



    Things to note based on common suggestions I've read:
    • The Placement ID and Game ID are correct for every ad unit.
    • The API key and Organization Core ID are correct
    • Test Ads are DISABLED. We are using live ads
    • We can view ads no problem on any device. However I assume they are from AdMob, not Unity Ads
    • We have AdSense and Google Ads accounts linked already
    • We have a high Match Rate (95.64%)
    • We have the correct app-pub id in Unity.

    We are very new to Google AdMob and mediation advertisement in general. If additional information is needed to resolve these issues please request it from me.

    Thank you,
    - Scuffed CD




     
  2. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    Is there any device logs available so we can check if Unity Ads SDK is running properly?
     
  3. ScuffedCD

    ScuffedCD

    Joined:
    Feb 4, 2020
    Posts:
    41
    Where/how would I get the device logs?

    Also Update: Fixed a few things and made adjustments to the AdMob account and app-ads.txt to hopefully resolve some issues. Will be testing a new build later today to see if it improves
     
  4. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
  5. ScuffedCD

    ScuffedCD

    Joined:
    Feb 4, 2020
    Posts:
    41

    I actually have a built-in console to see any debug messages, everything runs fine it seems, but the AdMob initialization message seems a bit off. I can try to get the entire console log if this is not enough.

    Code (CSharp):
    1. [09:53:24.4128800] Initialization processed with status GoogleMobileAds.Api.InitializationStatus
    2.  
    3. [09:53:24.4130820] Loading Interstitial
    4.  
    5. [09:53:26.8180270] Ad loaded with response **response info**
    6.     Response ID: CMukk-727_4CFaPBKAUdnAcHTg
    7.     Network: GADMadapterGoogleAdMobAds
    8.  
    9.     **Loaded Adapter Response**
    10.     Network: GADMAdapterGoogleAdMobAds
    11.     Ad Source Name: AdMob Network
    12.     Ad Source ID: 5450213213286189855
    13.     Ad Source Instance Name: AdMob Network
    14.     Ad Source Instance ID: AdMob Network
    15.     AdUnitMapping:
    16.     {
    17.     }
    18.  
    19.     Error: (null)
    20.     Latency: 0.320
    21.  
    22.     **Extras Dictionary **
    23.     {
    24.         *mediation_group_name* = "Interstitial_IOS";
    25.     }
    26.  
    27.     **Mediation line items **
    28.     Entry (1)
    29.     Network: GADMAdapterGoogleAdMobAds
    30.     Ad Source Name: AdMob Network
    31.     Ad Source ID: 5450213213286189855
    32.     Ad Source Instance Name: AdMob Network
    33.     Ad Source Instance ID: AdMob Network
    34.     AdUnitMapping:
    35.     {
    36.     }
    37.  
    38.     Error: (null)
    39.     Latency: 0.320

    Some things I noticed:
    - I Don't see any mention of Unity Ads mediation in here, not sure if it should be listed under Adapter Response or Mediation Line Items
    - "LoadingInterstitial" is being called before the AdInfo Response is called. I know that you have to load ads after the callback in order to make sure all mediation sources, load. I am doing this but I think the console says otherwise. Here is the code being called to run this (From an Awake() function)

    Code (CSharp):
    1.    
    2. private void SetupAds()
    3. {
    4. #if UNITY_IOS
    5.         _inter = _appleINTER;
    6.         _reward = _appleREWARD;
    7. #endif
    8.  
    9. #if UNITY_ANDROID
    10.         _inter = _androidINTER;
    11.         _reward = _androidREWARD;
    12. #endif
    13.  
    14.         _giveReward = false;
    15.  
    16.         MobileAds.Initialize((InitializationStatus initStatus) =>
    17.         {
    18.             Debug.Log("Initialization processed with status " + initStatus);
    19.  
    20.             LoadInterstitial();
    21.             LoadRewardedAd();
    22.         });
    23.  
    24.         RequestConfiguration request = new RequestConfiguration.Builder()
    25.             .SetTagForChildDirectedTreatment(TagForChildDirectedTreatment.True)
    26.             .SetTagForUnderAgeOfConsent(TagForUnderAgeOfConsent.True).build();
    27.  
    28.         MobileAds.SetRequestConfiguration(request);
    29.  
    30.     }

    Also just noticed that I am setting the RequestConfiguration after I Initialize MobileAds. Should I be doing this before? Can I even call MobileAds.SetRequestConfiguration() before I initialize it?
     
  6. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    I don’t seem to see any Unity Ads-related content in the log you provided. Please check if you have integrated Unity Ads correctly. If everything is normal, you should see content related to the "UnityAds" keyword in the log. For Admob integration issues, you can refer to Admob documentation or further ask Admob technical support.