Making Money with Android

Is my mediation implementation correct? (Admob/Mobfox)

Sorry for this lengthy post, but I am at a loss and included everything concerning the issue:

I am switching to mediation.
I use Admob as the primary network, simply because I am using Admob already and Admob includes many networks out of the box. The secondary network is Mobfox.

Unfortunately Admob’s documention on mediation is NOT very in-depth.

I have been using admob with the adview setup in xml (not in code).

So, to implement mediation I did the following:

In MobFox dashboard:
[ul]
[li]Requested approval, after approval I got the Mobfox publisher ID from the dashboard
[/li][/ul]

In Admob dashboard:
[ul]
[li]Enabled the mediation
[/li][li]added Mobfox as ad network
[/li][li]entered the Mobfox publisher ID as publisher ID for the Mobfox network
[/li][li]Got the Admob mediation ID
[/li][/ul]

In my app:
[ul]
[li]Copied the Mobfox .jar into my /libs folder.
[/li][li]Added the Mobfox .jar to the build path.
[/li][li]As I am using the GoogleAdMobAdsSdk-6.1.0.jar already, I left that untouched (Admob docs state it is the same SDK for mediation)
[/li][li]Added the following line to the <application> tag of Manifest.xml: [/li]```


[li]Admobs' activity is already there: [/li]```
<activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>

[li]Replaced the old [/li]> ads:adUnitId
in the layout xml with the new mediation ID, which I got from Admobs’ dashboard.
[li]Left the old code untouched, because, if not using mediation, Admob states that integration can be largely done by xml. However, when switching to mediation, Admob does not say anything if the integration can be done by xml or if I have to code the integration. This bugs me, because I am not sure what is correct. (Admob’s mediation example only shows how to implement mediation with code.)
[/li]This is the code:

		    adView = (AdView) findViewById(R.id.ad_view);
		    AdRequest adRequest = new AdRequest();
		    adRequest.addTestDevice(TEST_DEVICE_ID); 
		    adView.loadAd(adRequest);	

[li]No additional permissions, left them like the old version.
[/li][/ul]

Compiled a signed .apk, installed it, and everythings seems to be working:
[ul]
[li]But unlike without mediation, sometimes, I dont get an ad (Before with Admod alone, I had a fillrate of nearly 100% and always got an ad) :huh:
[/li][li]I dont know how to distinguish, if the ads I receive are from Mobfox or Admob :huh:
[/li][/ul]

How do I know if everything is setup correctly? :huh:
And if everything is setup correctly, why I am not getting an ad sometimes? :huh:

To verify if I am getting Mobfox ads, I switched off Admob in the Admob’s mediation dahsboard. But I have the feeling, I am getting the same ads like with Admob switched on? :huh:

Open up DDMS (logcat viewer), and filter by “tag:Ads”. This will show you debug messages from the AdMob SDK. Normally it lets you know when ads are not loading, and for what reason.

If it’s not AdMob’s SDK at fault, you could try searching logcat for the Mobfox log messages too. Hopefully this could give you some indication of what’s going on.

One thing to bear in mind - AdMob Mediation caches your settings (which networks are enabled / disabled) for 300 seconds. So if you make a change on the Mediation Dashboard, you won’t see any difference in your app behaviour until you’ve waited at least 300 seconds and restarted it twice (to allow the new settings to load).

[attachment=188][attachment=188]

And, yes, I am aware that it takes 300 seconds to become active after any change. But this isn’t the issue.

However, I found 1 error, I had the wrong (standard) Mobfox .jar added, instead of Mobfox Mediation .jar.
Fixed that and the error disappeared.

But now I notice 2 things:
[ul]
[li]I am getting different ads, not the once I usually received from Admob
[/li][li]The ads are not scaled properly, they dont fill the entires space: they are smaller in width and smaller in height, and barely readable. See attached screenshot.
[/li][/ul]

This is LogCat filtered by tag:Ads:

08-06 00:10:56.464: I/Ads(32166): To get test ads on this device, call adRequest.addTestDevice("DC61D1FB9342165D85C71B23238DDD48");
08-06 00:10:57.086: I/Ads(32166): adRequestUrlHtml: <html><head><script src="http://media.admob.com/sdk-core-v40.js"></script><script>AFMA_getSdkConstants();AFMA_buildAdURL({"preqs":0,"session_id":"3574673482776328771","u_sd":1.5,"seq_num":"1","slotname":"ef117243517c4670","u_w":320,"msid":"com.radlmaier.heiligenkalender.rk","js":"afma-sdk-a-v6.1.0","toar":0,"mv":"8013015.com.android.vending","isu":"DC61D1FB9342165D85C71B23238DDD48","cipa":1,"format":"320x50_mb","net":"wi","app_name":"125.android.com.radlmaier.heiligenkalender.rk","hl":"de","u_h":533,"carrier":"26202","ptime":0,"u_audio":3});</script></head><body></body></html>
08-06 00:10:58.672: W/AdsProvider(32220): No active account or specified account could not be found; aborting
08-06 00:11:02.824: I/Ads(32166): Received ad url: <url: "http://e.admob.com:80/mediate?session_id=3574673482776328771&seq_num=1&slotname=ef117243517c4670&js=afma-sdk-a-v6.1.0&isu=DC61D1FB9342165D85C71B23238DDD48&caps=inlineVideo_interactiveVideo_mraid1_clickTracking_sdkAdmobApiForAds&jsv=29" type: "gwhirl" afmaNotifyDt: "null">
08-06 00:11:03.675: I/Ads(32166): Caching gWhirl configuration for: 300 seconds
08-06 00:11:25.422: I/Ads(32166): To get test ads on this device, call adRequest.addTestDevice("DC61D1FB9342165D85C71B23238DDD48");
08-06 00:11:26.082: I/Ads(32166): adRequestUrlHtml: <html><head><script src="http://media.admob.com/sdk-core-v40.js"></script><script>AFMA_buildAdURL({"preqs":1,"session_id":"3574673482776328771","u_sd":1.5,"seq_num":"3","slotname":"ef117243517c4670","u_w":533,"msid":"com.radlmaier.heiligenkalender.rk","js":"afma-sdk-a-v6.1.0","toar":0,"mv":"8013015.com.android.vending","isu":"DC61D1FB9342165D85C71B23238DDD48","cipa":1,"format":"320x50_mb","net":"wi","app_name":"125.android.com.radlmaier.heiligenkalender.rk","hl":"de","u_h":320,"carrier":"26202","ptime":28956,"u_audio":3});</script></head><body></body></html>
08-06 00:11:30.043: I/Ads(32166): Received ad url: <url: "http://e.admob.com:80/mediate?session_id=3574673482776328771&seq_num=3&slotname=ef117243517c4670&js=afma-sdk-a-v6.1.0&isu=DC61D1FB9342165D85C71B23238DDD48&caps=inlineVideo_interactiveVideo_mraid1_clickTracking_sdkAdmobApiForAds&jsv=29" type: "gwhirl" afmaNotifyDt: "null">
08-06 00:11:31.039: I/Ads(32166): Caching gWhirl configuration for: 300 seconds
08-06 00:11:31.605: W/AdsProvider(32287): No active account or specified account could not be found; aborting
08-06 00:11:43.230: I/Ads(32166): To get test ads on this device, call adRequest.addTestDevice("DC61D1FB9342165D85C71B23238DDD48");
08-06 00:11:44.707: I/Ads(32166): adRequestUrlHtml: <html><head><script src="http://media.admob.com/sdk-core-v40.js"></script><script>AFMA_buildAdURL({"preqs":2,"session_id":"3574673482776328771","u_sd":1.5,"seq_num":"5","slotname":"ef117243517c4670","u_w":320,"msid":"com.radlmaier.heiligenkalender.rk","js":"afma-sdk-a-v6.1.0","toar":0,"mv":"8013015.com.android.vending","isu":"DC61D1FB9342165D85C71B23238DDD48","cipa":1,"format":"320x50_mb","net":"wi","app_name":"125.android.com.radlmaier.heiligenkalender.rk","hl":"de","u_h":533,"carrier":"26202","ptime":46765,"u_audio":3});</script></head><body></body></html>
08-06 00:11:46.261: W/AdsProvider(32353): No active account or specified account could not be found; aborting
08-06 00:11:46.300: I/Ads(32166): Received ad url: <url: "http://e.admob.com:80/mediate?session_id=3574673482776328771&seq_num=5&slotname=ef117243517c4670&js=afma-sdk-a-v6.1.0&isu=DC61D1FB9342165D85C71B23238DDD48&caps=inlineVideo_interactiveVideo_mraid1_clickTracking_sdkAdmobApiForAds&jsv=29" type: "gwhirl" afmaNotifyDt: "null">
08-06 00:11:47.183: I/Ads(32166): Caching gWhirl configuration for: 300 seconds
08-06 00:12:47.234: I/Ads(32166): Refreshing ad.
08-06 00:12:49.601: W/AdsProvider(32423): No active account or specified account could not be found; aborting
08-06 00:13:47.293: I/Ads(32166): Refreshing ad.
08-06 00:13:48.793: W/AdsProvider(32463): No active account or specified account could not be found; aborting
08-06 00:14:47.355: I/Ads(32166): Refreshing ad.
08-06 00:14:48.922: W/AdsProvider(32503): No active account or specified account could not be found; aborting

So, I am obviously getting mediated ads, but I dont know from which ad network.
My eCPM for MobFox is 0,01 $ and for Admob is 0,00 $, so actually Mobfox is the first in the chain?

I filtered LogCat for tags:Mobfox, but nothing appears?

[ol]
[li]How do I fix the incorrect scaling?
[/li][li]Do I receive Mobfox ads?
[/li][li]If I dont receive Mobfox ads, what could be the problem?
[/li][/ol]

screenshot-with-incorrect-scaled-ad.png

UPDATE:
[ol]
[li]Although I did not change anythibg, the ads seem to scale correctly now. I only sent an e-mail to Mobfox support, but I did not get an answer yet. As I switched to % allocation and allocated 100% to Mobfox, the ads, which I am receiving, must be from Mobfox.
[/li][li]I am receiving Mobfox ads, because I see impressions and clicks in Mobfox’ dashboard.
[/li][li]All seems to work for now… let’s see if no problems will pop up
[/li][/ol]

Unfortunately the incorrect scaling appears again :huh: :frowning:

The incorrect scaling seems to be only happening with Mobfox ads. Admob and Adfonic ads display correctly. I think, it is a similar issue as incorrect scaling of madvertise ads, which people report http://www.androidpit.de/de/android/forum/thread/435175/Rescale-Madvertise-Banner-Image#p793371

Unfortantely, the solution described, does not apply for Admob mediation.