Search code examples
unity-game-engineadmobmobile-ad-mediation

Cant Retrieve Data for Unity Ads when using ad mediation with Admob


I'm trying to implement Unity ad mediation using admob. I have followed the instructions here to the letter: https://developers.google.com/admob/unity/mediation/unity and https://developers.google.com/admob/unity/mediate but even after 4 days Unity Ads is shown as cant retrieve data. This can be seen in the screenshot below:

enter image description here

As can be seen, I'm getting a match rate, but nothing else other than that.

As per the instructions in the above links I have initialized my sdk with the following in Start()

// Initialize the Mobile Ads SDK.
        MobileAds.Initialize((initStatus) =>
        {
            Dictionary<string, AdapterStatus> map = initStatus.getAdapterStatusMap();
            foreach (KeyValuePair<string, AdapterStatus> keyValuePair in map)
            {
                string className = keyValuePair.Key;
                AdapterStatus status = keyValuePair.Value;
                switch (status.InitializationState)
                {
                case AdapterState.NotReady:
                    // The adapter initialization did not complete.
                    MonoBehaviour.print("Adapter: " + className + " not ready.");
                    break;
                case AdapterState.Ready:
                    // The adapter was successfully initialized.
                    MonoBehaviour.print("Adapter: " + className + " is initialized.");
                    break;
                }
            }
        });

And when using adb logcat I can see that both are initialized as per the following output:

08-11 20:29:58.961  6777  6865 I Unity   : Logged in successfully!
08-11 20:29:58.961  6777  6865 I Unity   : System.Action`1:Invoke(T)
08-11 20:29:58.961  6777  6865 I Unity   : System.Action`2:Invoke(T1, T2)
08-11 20:29:58.961  6777  6865 I Unity   : System.Action`1:Invoke(T)
08-11 20:29:58.961  6777  6865 I Unity   : System.Action`1:Invoke(T)
08-11 20:29:58.961  6777  6865 I Unity   : System.Action:Invoke()
08-11 20:29:58.961  6777  6865 I Unity   : GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
08-11 20:29:58.961  6777  6865 I Unity   :
08-11 20:29:58.961  6777  6865 I Unity   :  [Play Games Plugin 0.10.09] 08/11/21 20:29:58 +01:00 DEBUG: Authentication succeeded
08-11 20:29:58.961  6777  6865 I Unity   : System.Action:Invoke()
08-11 20:29:58.961  6777  6865 I Unity   : GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
08-11 20:29:58.961  6777  6865 I Unity   :
08-11 20:29:59.254  6777  6777 I Unity   : ~~~~~~~~~~~~~~~~~~~ Adapter: com.google.android.gms.ads.MobileAds is initialized. ~~~~~~~~~~~~~~~~~~~
08-11 20:29:59.254  6777  6777 I Unity   : <>c:<Awake>b__66_0(InitializationStatus)
08-11 20:29:59.254  6777  6777 I Unity   : System.Action`1:Invoke(T)
08-11 20:29:59.254  6777  6777 I Unity   : System.Action`1:Invoke(T)
08-11 20:29:59.254  6777  6777 I Unity   : System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
08-11 20:29:59.254  6777  6777 I Unity   : UnityEngine.AndroidJavaProxy:Invoke(String, Object[])
08-11 20:29:59.254  6777  6777 I Unity   : UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr)
08-11 20:29:59.254  6777  6777 I Unity   :
08-11 20:29:59.255  6777  6777 I Unity   : ~~~~~~~~~~~~~~~~~~~ Adapter: com.google.ads.mediation.unity.UnityMediationAdapter is initialized. ~~~~~~~~~~~~~~~~~~~
08-11 20:29:59.255  6777  6777 I Unity   : <>c:<Awake>b__66_0(InitializationStatus)
08-11 20:29:59.255  6777  6777 I Unity   : System.Action`1:Invoke(T)
08-11 20:29:59.255  6777  6777 I Unity   : System.Action`1:Invoke(T)
08-11 20:29:59.255  6777  6777 I Unity   : System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
08-11 20:29:59.255  6777  6777 I Unity   : UnityEngine.AndroidJavaProxy:Invoke(String, Object[])
08-11 20:29:59.255  6777  6777 I Unity   : UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaProxy, IntPtr, IntPtr)
08-11 20:29:59.255  6777  6777 I Unity   :
08-11 20:30:03.899  6777  7745 I Unity   : HandleRewardedAdLoaded event received and Reward Ad loaded!

Can anyone offer any suggestion on how to fix this?


Solution

  • So I may have fixed it as the cant retrieve data message changed and I got a couple impressions. Maybe in a day or two when its better optimized it starts working as expected.

    Go to your Unity Dashboard for Monetization -> Open your project for this game -> Project Settings -> Test Mode

    Then select "Override client test mode".

    Select Force Test Mode On. Save

    And then Force Test Mode Off.

    Then after a day the cant retrieve data disappeared and I started getting impressions