I try to add admob, but I have some problem with it.
This is the code for the test, it looks ok:
AdView adView = new AdView(this, AdSize.BANNER, pubID);
AdRequest adRequest = new AdRequest();
adRequest.addTestDevice(AdRequest.TEST_EMULATOR); // Emulator
adRequest.addTestDevice("TEST_DEVICE_ID");
adView.loadAd(adRequest);
And this code with pubID
AdView adView = new AdView(this, AdSize.BANNER, pubID);
adView.loadAd(new AdRequest());
I can't understand what's wrong... Just admob is not showing. That's all...
Can anyone help me with this problem?
Regards, Peter.
UPD oh sorry. Also all settings set in manifest file( permission , and adsense activity)
upd
all response from admob in logcat :
01-11 21:49:31.805: I/Ads(363): To get test ads on this device, call adRequest.addTestDevice(AdRequest.TEST_EMULATOR);
01-11 21:49:33.405: I/Ads(363): adRequestUrlHtml: <html><head><script src="http://media.admob.com/sdk-core-v40.js"></script><script>AFMA_buildAdURL({"preqs":0,"u_sd":1,"slotname":"a14f0d9ca22bc53","u_w":320,"msid":"activityM.activity.com","simulator":1,"cap":"m,a","js":"afma-sdk-a-v4.3.1","isu":"B3EEABB8EE11C2BE770B684D95219ECB","cipa":0,"format":"320x50_mb","net":"ed","app_name":"1.android.activityM.activity.com","hl":"en","u_h":480,"u_audio":4});</script></head><body></body></html>
01-11 21:49:41.714: I/Ads(363): Received ad url: <"url": "http://googleads.g.doubleclick.net:80/mads/gma?preqs=0&u_sd=1&slotname=a14f0d9ca22bc53&u_w=320&msid=activityM.activity.com&cap=m%2Ca&js=afma-sdk-a-v4.3.1&isu=B3EEABB8EE11C2BE770B684D95219ECB&cipa=0&format=320x50_mb&net=ed&app_name=1.android.activityM.activity.com&hl=en&u_h=480&u_audio=4&u_so=p&output=html®ion=mobile_app&u_tz=0&ex=1&client_sdk=1&pto=0&jsv=1", "afmaNotifyDt": "null">
01-11 21:49:42.255: I/Ads(363): onFailedToReceiveAd(Ad request successful, but no ad returned due to lack of ad inventory.)
That's all what i found in ddms.
This tells all.
01-11 21:49:42.255: I/Ads(363): onFailedToReceiveAd(Ad request successful, but no ad returned due to lack of ad inventory.)
This has happened to me sometimes. They just don't have any ads to send out at the moment for whatever reason. They will eventually pop up when they have something in their inventory. Nothing to worry about, just keep checking and it will eventually pop up.
I have the same problem. But I think the Google Admob FAQ has the answer
https://developers.google.com/mobile-ads-sdk/kb/#whynoads
Quote:
I think I've implemented everything correctly, so why am I not seeing
ads?
While maintaining the highest possible fill rate is one of our top
priorities, we may not always have an ad available for every ad
request. This can be especially common during development, when ad
requests are typically made infrequently from a small number of users
and devices. When apps are newly registered on AdMob it may also take
some time and several requests before impressions are consistently
delivered. Developers generally see more consistent results once they
have released their app and ad requests arrive more frequently from a
more diverse user base.
Note: The very first time AdMob sees your publisher ID it may take up
to two minutes to receive an ad, and this initial two minute lag will
recur every time the app goes unused for 24 hours.
And yes, the admob reports showing low request count.
Related
I implement Admob in one of my android application. First time it has a banner add bellow of my application. But after adding banner ad in RecylearView after 8 items then problem occurs. 90% cases it returns response code 3.
Maximum time it showing me:
I/Ads: No fill from ad server.
W/Ads: Failed to load ad: 3
Here response code: 3 means The ad request was successful, but no ad was returned due to lack of ad inventory. But other apps showing ads frequently in same device.
Notes:
It showing demo ad when i test in TestDevice
Problem occurring only non test devices
Rare cases it successfully return ad.
Can anyone please help me to recover from this issue.Is there any issue in my ad_unit or adMob?
Here my code is correct. The issue is that AdMob does not always have an ad to return for every request. This may happen particularly if you have just registered your AdMob publisher ID, as it takes some time and multiple requests before the new ID starts returning ads.
Another reason your fill rate may be low is that you don't have AdSense backfill enabled, or you have filtered out some ads. Check your app settings to see if that is the case.
According to documentation :-
public static final int ERROR_CODE_NO_FILL
The ad request was successful, but no ad was returned due to lack of ad inventory.
Constant Value: 3
Which means:-
If you are getting this error, then your code is correct. The issue is
that AdMob does not always have an ad to return for every request.
This may happen particularly if you have just registered your AdMob
publisher ID, as it takes some time and multiple requests before the
new ID starts returning ads.
Another reason your fill rate may be low is that you don't have
AdSense backfill enabled, or you have filtered out some ads. Check
your app settings to see if that is the case.
Thanks :)
I want to add my app to "Designed for families", but for mixed audience, so as official documentation said I change my ads request like this:
Bundle extras = new Bundle();
extras.putBoolean("is_designed_for_families", true);
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.addNetworkExtrasBundle(AdMobAdapter.class, extras)
.tagForChildDirectedTreatment(true)
.build();
The problem is that when I put the "is_designed_for_families" extra, no ads is displayed.
W/Ads: Failed to load ad: 3
Update: I know that error 3 means that admob doesn't have an ad to show at the moment, but I have set "test device" so it should show test ads.
I haven't marked as "Designed for families" in Google Play yet, because I want to check that the ads are displaying correctly.
Any ideas about what is happening?
Error code 3 means that admbob doesn't have an ad to show at the moment.
This means that your code implementation is correct but at the moment there are no ads to show.
Also, if you have just implemented admob, it could take some time for it to start sending you ads. This is called "Warming up" and it could take up to a couple of days (depending on the number of ad requests).
Update: If you receive a NO FILL error (code: 3) while testing "Designed for families" ads, the test ad will not be shown.
To test if your admob implementation works, just remove the extra "is_designed_for_families".
This is the intended behaviour of the admob sdk. Source
You can change AdMob with another because AdMob look at your app settings in the play store and check if its a "familey" app
see this website
https://www.quora.com/Which-is-a-better-alternative-to-AdMob-for-Android-ad-platform
android interstitial ad is displaying for test device
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice("XXXXXXXXXXXXXX")
.build();
interstitial.loadAd(adRequest);
But after publishing(removed the "addTestDevice" line), I cannot see any ad. It always returns error code "ERROR_CODE_NO_FILL".(from logcat)
I searched a lot, but couldn't get a satisfactory answer. Is it one of the android's million bugs?
The below is my admob dashboard screenshot. It has some few requests, but no impression. This is not due to my code problem as I am displaying the ad, but loading itself fails after request : ERROR_CODE_NO_FILL
NO_FILL is a standard response. It means that you made a request on the ad network and the ad network has no inventory for you.
The solution is to use mediation to hand off to other ad networks when the first doesn't have any fill. Admob provides a good out of the box mediation.
Using Android Admob sdk I receive same banner all the time. On different devices banner is different.
Traces show request for ad and response.
No error or warnings about admob.
Code from my program:
OnCreate()
{
....
AdRequest adRequest = new AdRequest();
m_adView.loadAd(adRequest);
}
Here is request sent from admob sdk to server:
10-12 13:09:28.828: I/Ads(3865): adRequestUrlHtml: AFMA_buildAdURL({"preqs":10,"session_id":"5459438313201923230","u_sd":1.5,"seq_num":"19","slotname":"a14faa4a66469eb","u_w":320,"msid":"com.datecs.bgmaps","js":"afma-sdk-a-v6.1.0","toar":0,"mv":"8014017.com.android.vending","isu":"CF95DC53F383F9A836FD749F3EF439CD","cipa":0,"format":"320x50_mb","net":"wi","app_name":"25.android.com.datecs.bgmaps","hl":"bg","extras":{"_norefresh":"t","gw":1,"mad_hac":"1"},"u_h":533,"carrier":"28401","ptime":362288,"u_audio":3});
I saw "_norefresh" in request url, but I control banners from admob site - refresh rate 45sek. So tis souldn't be a problem.
Any suggestions?
Even if I stop internet - my ads continue to show on screen. sdk repeats last banners cached somewhere in device. On 20-30 ad request I receive once: 'No ads to serve for you' or some like this. So Admob repeat last banners when there is no connection or no new ads from google.
False alarm and spent 2 days to fight nonexistent problem.
I've got AdMob integrated with my Phonegap application, and everything appears to be working in test (when I have request.addTestDevice(AdRequest.TEST_EMULATOR); set, I can see the test ad) but when I run it on a device I see no ads. I'm getting a message that says onFailedToReceiveAd(Ad request successful, but no ad returned due to lack of ad inventory.). I've read that this is just due to AdMob not having anything to display at the time; however, on my AdMob console, I'm not showing that the Site Status is inactive, and I'm not showing any requests. Any idea what I could be doing wrong?
Here is the code I used to get the ads (and yes, my publisher ID is correct, I've copied and pasted it several times):
this.adView = new AdView(this, AdSize.BANNER, "a14e85e6e674aa6");
this.appView.addView(this.adView);
AdRequest request = new AdRequest();
this.adView.loadAd(request);
You're NOT showing that the site status is inactive? Don't you mean that you ARE showing an inactive site status?
The code that you have posted here works. What you've read is true, ads don't fill 100% of the time. In addition, it sometimes takes a while for new apps to start receiving real ads.