Admob mediation for UnityAds on Unity

167 views
Skip to first unread message

Abyte Entertainment

unread,
Apr 26, 2017, 6:02:23 AM4/26/17
to Google Mobile Ads SDK Developers
Hi,
I am struggling with AdMob mediation for UnityAds in Unity and I'm trying to verify my correct (or incorrect) implementation of the mediation.
I am testing on my tablet a build which will be released very soon in Beta but I was never able to see a UnityAds ad to test/verify that the mediation is actually taking place, nor any logs that can confirm that mediation is implemented correctly. But of course I want to be sure before releasing in Beta and then in Production.

My question is: is it possible that the mediation is "prevented" in some cases? May be my device is seen as a test device? This is my best guest, just because I see this log:
"04-25 14:15:06.910: I/Ads(19896): Use AdRequest.Builder.addTestDevice("[...]") to get test ads on this device."
Or may be there is anything else which I am missing?

Additional info / what I have done:
- Mediation is correctly configured in AdMob Dashboard, I correctly see "2 ad sources" and one is UnityAds (with auto eCPM correctly extracted), I also disabled "auto eCPM" for both and in order to force the network to choose UnityAds I manually set its eCPM to 20$ on all country and, on the other hand, the AdMob eCPM to 0.01$ only on another country (so that here it can not be chosen, with the option "Disable Ad requests to all other countries"). The Ad unit ID is: ca-app-pub-6020355779254219/4436300287 , which is a rewarded video with no cap limits and it is currently not implemented in production as currently we have only interstitials with AdMob (and so it's useful for this kind of testing, I can modify the settings in the dashboard without having impacts on production ads).
- AdMob Unity plugin latest version 3.4.0, which I updated in this release from version 3.3.0. The plugin is correctly integrated and initialized as soon as there is internet connection, which is right at the start of the game, in my tests, I see the logs for the ads ready and I see with no problems AdMob ads.
- UnityAds (latest version, 2.1.0 plugin from Unity Asset Store) is correctly configured and integrated in my game, as a matter of fact in this very release I am switching (or trying to switch) from "code mediation" (with means direct calls to UnityAds and AdMob with a configured hierarchy to check for available ads) to AdMob mediation to increase the efficiency of this process. So the UnityAds plugin is already integrated in my game, I already removed all related initialization and all calls for UnityAds in the code and now the only initialization and the only calls are the ones for AdMob. A doubt here: is it necessary to keep the initialization of UnityAds in order for the mediation to work? I found no evidence of this anywhere on the documentation, but it's better to ask here.
- UnityAds adapter (last version, unity-2.1.0.0.aar) is in "Assets\Plugins\Android\GoogleMobileAdsPlugin\libs", never had any kind of error on logs that can make me think that this integration has any issue but also no confirmation that the mediation is actually taking place. The readme on the adapter page refers to Android (for example it refers to a build.gradle which is not present on Unity, no information about any change to AndroidManifest.xml) and there are no instruction on what to do in Unity, I just put it in that directory and I have not done anything else.
- Unity version is 5.5.1f1.

AdMob Integration was very easy but this inability to test properly the mediation is costing me a lot of hours, any help on this will be very appreciated.

Abyte Entertainment

unread,
Apr 26, 2017, 12:46:04 PM4/26/17
to Google Mobile Ads SDK Developers
Other additional info:
- I am testing on Android, sorry I gave it for granted.
- I found a post in this thread (with a reply from Joshua) where there are the exact steps I followed, apart from having no evidence of any "unity-ads folder" (as per the second point of Joshua answer) in any of the integration tools. Is this the Unity Ads directory from the UnityAds asset with all the DLLs? Those are in a dedicated directory "Assets\UnityAds".
- I found a post in this thread (with a reply from Veer) which states that all the SDKs and the adapters should be in "Assets\Plugins\Android\GoogleMobileAdsPlugin\libs" which is in conflict with the previous thread, as Joshua said that the SDK should be in "Assets\Plugins\Android" and the adapters in "Assets\Plugins\Android\GoogleMobileAdsPlugin\libs". Which of the two statement is correct?
- I have now managed to have at least an error on the logs (filtering by "Ads" tag):
04-26 18:05:30.083: W/Ads(22614): Fail to instantiate adapter com.google.ads.mediation.unity.UnityAdapter
04-26 18:05:30.083: W/Ads(22614): android.os.RemoteException
04-26 18:05:30.083: W/Ads(22614): at com.google.android.gms.internal.zzjz.zzav(Unknown Source)
04-26 18:05:30.083: W/Ads(22614): at com.google.android.gms.internal.zzjz.zzau(Unknown Source)
04-26 18:05:30.083: W/Ads(22614): at com.google.android.gms.internal.zzjz.zzas(Unknown Source)
04-26 18:05:30.083: W/Ads(22614): at com.google.android.gms.internal.zzka$zza.onTransact(Unknown Source)
04-26 18:05:30.083: W/Ads(22614): at android.os.Binder.transact(Binder.java:380)
04-26 18:05:30.083: W/Ads(22614): at com.google.android.gms.ads.internal.mediation.client.d.a(:com.google.android.gms.DynamiteModulesA:94)
04-26 18:05:30.083: W/Ads(22614): at com.google.android.gms.ads.internal.reward.c.b(:com.google.android.gms.DynamiteModulesA:229)
04-26 18:05:30.083: W/Ads(22614): at com.google.android.gms.ads.internal.reward.mediation.k.a(:com.google.android.gms.DynamiteModulesA:1140)
04-26 18:05:30.083: W/Ads(22614): at com.google.android.gms.ads.internal.util.b.run(:com.google.android.gms.DynamiteModulesA:19)
04-26 18:05:30.083: W/Ads(22614): at com.google.android.gms.ads.internal.util.ab.call(:com.google.android.gms.DynamiteModulesA:1055)
04-26 18:05:30.083: W/Ads(22614): at com.google.android.gms.ads.internal.util.ac.run(:com.google.android.gms.DynamiteModulesA:75)
04-26 18:05:30.083: W/Ads(22614): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
04-26 18:05:30.083: W/Ads(22614): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
04-26 18:05:30.083: W/Ads(22614): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
04-26 18:05:30.083: W/Ads(22614): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
04-26 18:05:30.083: W/Ads(22614): at java.lang.Thread.run(Thread.java:818)

Which seems to suggest that: a) indeed the adapter has not been loaded, b) the changes on the dashboard (i.e.: the ones I did to "force" the mediation) took a very long time to be active, as I have experienced this error just today (good for me that I was very cautious and didn't release this build because of the aforementioned doubts).

- Attached you can find my current plugins configuration.

I am sorry to say that I am thinking of reverting this implementation, I find this lack of documentation very annoying (and certainly not expected from Google), I have now spent 3 days trying to imagine how this "should" be implemented (in almost an heuristic way, instead of a deterministic and documented way).
AndroidPlugins.PNG

Deepika Uragayala- MobileAds SDK team

unread,
Apr 26, 2017, 2:55:43 PM4/26/17
to Google Mobile Ads SDK Developers
Hi,

For all aar files, you would have to copy those  in Assets > Plugins > Android folder. I notice that you have copied UniyAd's SDK into the libs folder, which is wrong. You can check out this sample app, where I have added your Ad Unit ID, and it works.

Let me know if you have any other questions.

Regards,
Deepika Uragayala
Mobile Ads SDK Team

Abyte Entertainment

unread,
Apr 26, 2017, 3:29:03 PM4/26/17
to Google Mobile Ads SDK Developers
Hi Deepika,
first of all thank you for your support.
The Asset/Plugins/Android/libs folder in the screenshot is not opened (you can see the arrow pointing to the right), so everything below it (including UnityAds SDK which is unity-ads.aar) is in the Asset/Plugins/Android directory, which is correct from what you are telling me.

I'll check your sample app right now, thank you.
Reply all
Reply to author
Forward
0 new messages