"Failed to load ad: 3" with DoubleClick
Asked Answered
S

29

149

I'm setting an ad to my Android application using DoubleClick and can't manage to show the final ad. Can someone help me?

When I test an ad by adding ".addTestDevice("xxx...")" I get the test ad but when I remove this line I get the following error:

W/Ads: No fill from ad server

W/Ads: Failed to load ad: 3

I set my ad like this:

PublisherAdRequest adRequest = new PublisherAdRequest.Builder().build();
mPublisherAdView.loadAd(adRequest);

And my publisherView looks like this:

<com.google.android.gms.ads.doubleclick.PublisherAdView
    android:id="@+id/pronostics_ad"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"

    android:layout_gravity="center"

    ads:adSize="BANNER"
    ads:adUnitId="@string/ad_unit_pronostic">
</com.google.android.gms.ads.doubleclick.PublisherAdView>

What could be wrong?

Scatter answered 6/11, 2015 at 12:7 Comment(5)
The issue was due to a wrong language configuration. What seems strange is that this configuration didn't makes any problems with IOS devices but does with Android's one.Scatter
can you please clarify, what kind of "language configuration" you were referring to? I seem to be facing the same issue.Fye
This is more than 1 year ago and I don't have access anymore to the DoubleClick account so I can't help you so much. I know I had 3 languages (Fr, Nl, En) with Fr set as default and I couldn't get the NL & EN ones. If I remember well I switched to EN as default language configuration and that's it. I still doesn't understand why this solved my issue so sorry for not helping so much.Scatter
Check bellow answer https://mcmap.net/q/160512/-onfailedtoreceivead-ad-request-successful-but-no-ad-returned-due-to-lack-of-ad-inventory-when-using-admob-with-adwhirlRato
In my case I only changed to other virtual device and ads began load.Sukkah
C
211

W/Ads: Failed to load ad: 3

As per the Documentation you are getting the following error code:

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

Based on the post onFailedToReceiveAd - Ad request successful, but no ad returned due to lack of ad inventory when using admob with adwhirl:

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.

EDIT:

Update app-ads.txt and use "setTestDeviceIds" to test on physical device.

As of time of editing these instructions: https://developers.google.com/admob/android/test-ads worked. To test ads I used Demo ad Unit and needed to add the app-ads.txt line and wait for it to be crawled by admob crawler (which alone worked on Android-12 emulator), but still gotten instruction in Logcat to use the "setTestDeviceIds" - code under above link, which turned out to be required to display test ads on physical device connected via USB.

Conundrum answered 14/11, 2015 at 20:19 Comment(10)
What's backfill? The document didn't mention it.Benedick
i am using my ad unit id last one month sometime i get adds but most of the time admob return error 3.Wiersma
Sir! i have another app that belongs to the same AdMob account, and it is showing the ads. Please explainAmpereturn
I have the same problem, it can show ads first,but now it's getting error 3Quest
Sometimes there's no ads available for a particular device or a particular ad id. Advertisers do not want to repeat the same ad on the same device or ad id too many times, resulting in error 3Duna
The weird thing is that it happens for me with the test id, which as the documentation says, is /6499/example/bannerSticktight
BannerAd not refreshed after getting error 3. Again need to call loadAd(), than only ad will be loaded. Have any idea?Eulalie
Hi, I have the same issue, the ads show fine before but now I got error code 3. please helpOxbow
i got this error after admob send me mail of site behaviour navigationLampyrid
but I use test ads...Mel
W
34

There is one option which helped in our case. As @blizzard mentioned in your application settings in Google Developer Console there is a section which called "Pricing and Distribution". In this section there is a checkbox "CONTAINS ADS". In our case it was disabled. After enabling we successfully received ads.

enter image description here

Winglet answered 1/2, 2017 at 22:39 Comment(5)
Can you add screenshot or detail path for pricing and distribution, please? Also it is in apps.admob.com dashboard or in google developer console?Portage
Go to Google Play Console, after that choose All applications on the right side, select your app, choose Store presence on the right side, in drop down menu select Pricing & distributionWinglet
You are a savior! I was having mine turned off, I have just enabled it.Dissipate
This questin is about Error Code 3. Is this answer for this error code?Tai
Now it's under "App content" instead of "Pricing and distribution"Turpentine
P
25

I had the same error in my app. I was launching the app in debug configuration. The problem was solved as soon as I run the release version of my app on the same device. In Android Studio just go to Build -> Generate Signed APK and choose the release configuration. Then install release .apk on your device. In debug configuration you can also check whether your test ads appears by adding AdRequest.Builder.addTestDevice("YOUR TEST DEVICE"). If it's ok with ads appearing, it means you just need release configuration.

Pix answered 14/4, 2019 at 17:19 Comment(1)
In nowadays addTestDevice is deprecated and you have yo set AD unit ID. Reference: developers.google.com/admob/android/test-adsVascular
S
10

One new and update answer: Many apps that were removed this October(2018) for the lack of Privacy Policy are unable to receive ads after they get back in Play Store. You must use this form to request a "reset" for that app's ads. https://support.google.com/admob/contact/appeal_policy_violation

Took me a few days to realize and find the answer. Hope you get your ads back.

Squarerigged answered 24/10, 2018 at 15:18 Comment(9)
Can you please mention what you write in section: "What changes have you made to your app or account in order to comply with our program policies? *"Purgatorial
I added the required privacy policySquarerigged
Did you mean that you have copy and paste your privacy policy in that field of appeal??Purgatorial
Actually my app is now available on playstore after submitting the updated app with privacy policy, But Admob ads are not enabled.Purgatorial
I wrote in that field exatly this: "I added the required privacy policy"Squarerigged
Google is crazy now cause of policy changes. They tried to copy concept of apple but they are losing trust of developersDerris
@AnandSavjani That correct, every another month they update the policy. I have 78 apps uploaded on playstore. when any policy update comes I need to update nearly half of them. And the best part is that I am an individual developer :) . I don't get time for new development.Purgatorial
@ArbazAlam : please mail me on [email protected]. I have some good concept to discuss about policyDerris
@MariusRazvanVarvarei I'm unable to access this form. It's redirecting to support.google.com/admob/…Bossuet
G
6

W/Ads: Failed to load ad: 3

It Means that your code is correct but due to less amount of request to the server your ads are not Visible. To check the Test ADS you Should put the code in loop for some time, and you have to give multiple requests so that your admob receives multiple requests and will load the ads immediately.

Add the below code

for(int i=0;i<1000;i++) {
            AdRequest adRequest = new AdRequest
                    .Builder()
                    .addTestDevice("B431EE858B5F1986E4D89CA31250F732")
                    .build();
            accountSettingsBinding.adView.loadAd(adRequest);
        } 

Restart Your application multiple times.

Remove the Loop after you start receiving ads.

Goebel answered 18/3, 2019 at 8:36 Comment(3)
what is accountSettingsBinding here ?Falgout
accountSettingsBinding.adView.loadAd(adRequest); you can give your adview idGoebel
Cool got it. This did work for me but after around 24 hours of firing multiple requests. Thanks.Falgout
E
6

I hadn't published a version of my app with ads yet.

I was seeing error code 3: ERROR_CODE_NO_FILL after I switched from emulators with a debug version to a real device with the release version (installed through adb shell commands).

I waited 12+ hours and I could see ad requests on the AdMob portal, but no matches (match rate of 0%). I went to the Play Console > Store Presence > Pricing & distribution and switched the radio button for Contains ads to Yes, it has ads. I even tried uploading my app bundle (without publishing) to the Play Console. Neither of these worked.

Various AdMob help articles (including the one linked below) mention that if you've been seeing test ads (ads labeled with "Test Ad"), then your code is working and real ads should work as expected (once they build up inventory).

With that in mind, I went ahead and published my app to the Play Store and once the update was live, I downloaded it via the Play Store app on my real phone and the ads loaded no problem and my match rate is now sitting at 66% on AdMob. From the AdMob FAQ article, it sounds like it typically takes a few hours and could have taken up to 24 hours for ads to start showing.

ad mob FAQ re: how long does it take ads to show

Source: https://support.google.com/admob/answer/2993019?hl=en

Edirne answered 16/9, 2019 at 21:1 Comment(1)
Not necessary that your app it's live in Google Play or other platform if you activate Test Ads :)Karlenekarlens
C
5

This is a simple WORKAROUND (no solution):

You can install a mediation such as InMobi: https://developers.google.com/admob/android/mediation/inmobi

In this way, if for whatever reason admob is not showing you ads, you can still show them from other ad networks.

Charlsiecharlton answered 2/12, 2018 at 1:31 Comment(3)
do you know any a specific tutorial for this?Pentaprism
I just followed the instructions from that link. Anyways, I found that inmobi was not showing ads frequently (not even 50% of the time) so I'm not longer using it.Charlsiecharlton
Right now (8/15/2019), Google Admob is working for me (my app is "Match4app"). Match Rate is 100% and show rate is 80% for US, Canada and Spain, 75 % for Germany, etc.Charlsiecharlton
L
4

Option 1: Go to Settings-> search Reset advertising ID -> click on Reset advertising ID -> OK. You should start receiving Ads now

No search option? Try Option 2

Option 2: Go to Settings->Google->Ads->Reset advertising ID->OK

No Google options in Settings? Try Option 3

Option 3:Look for Google Settings (NOT THE SETTINGS)->Ads->Reset advertising ID

Lyublin answered 14/5, 2018 at 23:1 Comment(3)
is this located on AdMob menu?Drislane
There is NO such a thing as Google's "reset advertising ID" menu anywhere. Where?Mikol
this solution is for physical android devices. just search ads in SettingsValetudinary
P
3

Don't forget to add payment methods on Google AdMod. It was my issue with "Error code 3". Anyway, when your account Google AdMod will be ready to show ads (for tested device or real users) they send you email that your account verified and ready to work! After this letter everything should work fine.

Posterior answered 2/6, 2019 at 6:44 Comment(1)
Same here. AdMob says: "Provide your payment details This info is required before AdMob can serve your ads" , so check the payments settings in the AdMob portalHartman
S
1

I'm just going to leave this here incase it works for someone. After trying all the fixes mentioned in all the forums and posts what worked for me is simply using a global AdRequest object. I would use the same object when calling loadAd on each adView in each Activity. I have seen that it tends to load the same Ad on each AdView regardless of activity but at least now I get ads.

Sharlasharleen answered 18/2, 2019 at 8:43 Comment(0)
E
1

If your published app has no admob and its settings in Google Developer Console (called "Pricing and Distribution") "CONTAINS ADS" is uncheched. Always develop with test id with logcat output.

Elinorelinore answered 18/4, 2019 at 19:9 Comment(0)
C
1

On new admob version USE this :

//Load your adView before

    adView.setAdListener(new AdListener() {    


        @Override
        public void onAdFailedToLoad(int errorCode) {
            // Code to be executed when an ad request fails.
            Toast.makeText(Your current activity.this, "Ad failed: " + errorCode, Toast.LENGTH_SHORT).show();
        }




    });

If Ads load on your emulator, meaning that they return test ads, that should mean that there's nothing wrong with your code. Do they load test ads on your phone as well?

If you're able to see test ads on the emulator and test devices, then it usually just means that AdMob (assuming you're using AdMob) is unable to return an Ad due to a lack of Ad inventory. If this is the case, then when looking at the Logcat you should see the line W/Ads: Failed to load ad: 3.

What you should do is plug in an Android phone to your computer, and then in Android Studio click on Logcat, and in the top left you should see some devices to select from. Select your phone if it's listed (it should be). The logcat will now be printing everything your phone is printing. In the filter bar, type in ads to filter out stuff you don't need to see.

Then open your application in your phone, and check the logcat. Make sure your device isn't considered a test device. If you see W/Ads: Failed to load ad: 3 then that should mean that the problem lies with AdMob and not you.

If it doesn't say that and it says something else, then I obviously don't know.

Ciri answered 9/6, 2019 at 11:17 Comment(0)
R
1

There could be one of the reasons that You might have created your advertise from adMob console by clicking yes that your app is already in playstore and giving url of your live app.Now in that case you wont able to run your ads in any other projects which is having diff package id then the live one(not even test advertise).You have to implement the ads in live project containing same package id and in other case will be getting ad failed to load ad : 3.

Thanks! Happy coding!

Rockies answered 19/3, 2020 at 6:41 Comment(1)
This gives hint and makes senseOri
O
1

This error can be because of too much reasons. Try first with testAds ca-app-pub id to avoid admob account issues.

Check that you extends AppCompatActivity in your mainActivity, in my case that was the issue

Also check all this steps again https://developers.google.com/admob/android/quick-start?hl=en-419#import_the_mobile_ads_sdk

Outport answered 30/8, 2020 at 19:22 Comment(0)
C
1

It's not a problem. When you first design your application, you can use the test codes provided by AdMob. These codes work great on your emulators and on real devices. But as soon as you publish your application on Google Play, these codes stop working immediately. You need to make your test devices. https://developers.google.com/admob/android/test-ads

But you can use a life hack to continue using test codes for an already published application. Change the application ID in the build.gradle(android) file to a different name and everything will work. Do not forget to return the old name before publishing the application to the Market.

Costume answered 28/11, 2020 at 8:4 Comment(0)
B
1

For those facing future problems.

The information presented here does not exclude what has already been said by others, they are just complements, some more things to be taken into account.

As of Jan 2022, the app setup process has changed in admob. A notification was sent to the console with the following message:

All new apps added to AdMob need to be reviewed and approved. Make sure your AdMob apps are linked to a supported app store to prevent ad serving be interrupted. Linking generates an automatic review of the apps.

1-

As you know, there are two ways to configure an application in admob: Published and Unpublished.

If the app has already been published, and the SDK is implemented correctly, there will be no runtime errors, as long as the adsense policies and google platform

If you haven't published your app yet but want to run and test ads, you need to adhere to best practices.

Add your advertising ID/IDFA from your physical device used for testing on admob > settings > test-devices > create might be a good one.

This will allow you to keep your device as a test, even after publishing in the store.

2-

Do not use AdRequest.Builder.addTestDevice() in your code when you are debugging. It has been discontinued.

For debugging purposes, use RequestConfiguration.Builder.setTestDeviceIds() instead. You will have something like this:

public static final String TEST_J7 = "F1FDCA11111AF1111111FF11C1111111";
public static final String TEST_GRAN_PRIME = "F1FDCA11111AF1111111FF11C1111111";
public static final String TEST_XIAOMI = "F1FDCA11111AF1111111FF11C1111111";
public static final String TEST_EMULATOR = AdRequest.DEVICE_ID_EMULATOR;

// if you don't know the id, look it up in Logcat in a normal request
public void newConfiguration() {
  String[] tests = {TEST_EMULATOR, TEST_J7, TEST_GRAN_PRIME, TEST_XIAOMI};

  MobileAds.setRequestConfiguration(new RequestConfiguration.Builder()
     .setTestDeviceIds(Arrays.asList(tests)).build());
}

3-

Always use test ads to prevent delivery from being suspended:

public static final String TEST_UNIT_BANNER = "ca-app-pub-3940256099942544/6300978111";
public static final String TEST_UNIT_REWARD = "ca-app-pub-3940256099942544/5224354917";
public static final String TEST_UNIT_NATIVE = "ca-app-pub-3940256099942544/2247696110";
public static final String TEST_UNIT_INTERSTITIAL = "ca-app-pub-3940256099942544/1033173712";


public void loadAd(boolean is_test_device, String unit) {
  if (is_test_device) {
    newConfiguration();
  }
  AdRequest request = new AdRequest.Builder().build();

  AdView banner = new AdView(c);
  banner.setAdUnitId(is_test_device ? TEST_UNIT_BANNER : unit);
  banner.loadAd(request);
  //...
  InterstitialAd.load(c, is_test_device ? TEST_UNIT_INTERSTITIAL : unit, request, /*callback*/);
  //...
  RewardedInterstitialAd.load(c, is_test_device ? TEST_UNIT_REWARD : unit, request, /*callback*/);
  //...
}

According to the documentation:

Your app will receive limited ad serving until it is approved during the AdMob preparation process. In order for your app to be reviewed and approved by AdMob, you will need to list it on an AdMob-compatible store and link your app to the app store in your AdMob account.

The suspension of ads can last for up to 30 days, or be permanent in case of violation of adsense policies.

4-

After setting up your test device, reset your Advertising ID by going to Settings > Google > Ads > Reset Advertising ID on your physical device.

Don't forget to use your own unit_id in your distribution app.

Learn more here: About app readiness Set up a test device

Belch answered 3/2, 2022 at 1:42 Comment(0)
W
1

In my case this can reproduce if you put wrong ID for the incorrect widget. example: you put interstitialAds ID, to AdView Banner widget.

So make sure you put correct ID for the widget.

hope its help.

Wollongong answered 4/8, 2022 at 22:53 Comment(0)
S
0

If error continues last try is create a new placement in admob. This works for me. Without changing anything(except placement id string) else in code ads start displaying.

Sarpedon answered 11/5, 2018 at 10:29 Comment(0)
W
0

I've made the stupidest error. Passed app id into MobileAds.initialize from one app and used placement id in loadAd from another admob app.

Once I corrected placement id all come to work.

Witching answered 31/7, 2019 at 9:24 Comment(0)
D
0

For me the reason was that one device, a Xiaomi Mi 9 just was not working anymore and not displaying ads, so I pulled out my tablet and I saw no errors and it was displaying ads in the release.

Dripps answered 7/2, 2020 at 16:0 Comment(0)
G
0
Your ad units are not displaying ads because you haven't yet verified your address (PIN).

Maybe it helps to others, i received this notification on my AdSense account. enter image description here

Galvanic answered 11/4, 2020 at 15:0 Comment(0)
M
0

This works for me


Settings->Google->Ads->Reset advertising ID->OK

But In some cases, ads are automatically come after uploaded to the play store.

Martines answered 17/4, 2020 at 15:28 Comment(5)
Where are those menu??Opah
I haven't understood what type of menu are you talking about. But this setting is in your phone's settings.Martines
Can you tell more accurate where is it option? I don't see anywherePost
@DynoCris These settings are present under Google section, it's location is different from different phones. But one more thing, if we can't see your ad and receive the error "Failed to load ad: 3", this is totally fine. You will see the ad when you upload the app on play store or maybe when you build a released apk version.Martines
did not work in my caseDerr
W
0

W/Ads: Failed to load ad: 3

Means: The ad request was successful, but no ad was returned due to lack of ad inventory.

So, In my case, I have commented the keywords: property to load all types of ads. Now my ad is loading properly.

static final MobileAdTargetingInfo targetingInfo = MobileAdTargetingInfo(
        testDevices: testDevice != null ? <String>[testDevice] : null,
        nonPersonalizedAds: true,
        //keywords: <String>['Fitness', 'Yoga', 'Health', 'Exercise', 'Game', 'Doctor', 'Medical'],);
Windermere answered 12/5, 2020 at 11:34 Comment(0)
T
0
  1. Check And Make sure You Have not linked two accounts to adsense as I have mistakenly done in my case.

  2. if you are just creating your admob account waut for 24 hours and try again

Tangle answered 17/6, 2020 at 14:49 Comment(0)
P
0

My problem was with Payment. I refreshed my payment method and it helped me.

Post answered 10/9, 2020 at 22:0 Comment(0)
N
0

in my case :
I/Ads: Ad failed to load : Account not approved yet.

but you need to implement the listener for knowing the error

First import the listener : import com.google.android.gms.ads.AdListener;
Second create variable : private final String TAG2 = com.ringtones.splash.class.getSimpleName();

            mAdView.setAdListener(new AdListener() {
            @Override
            public void onAdLoaded() {Log.d(TAG2, "google banner ad loaded"); }
            @Override
            public void onAdFailedToLoad(LoadAdError adError) {Log.d(TAG2, "google banner ad failed to load : "+ adError.getMessage());}
            @Override
            public void onAdOpened() {Log.d(TAG2, "google banner ad opened");}
            @Override
            public void onAdClicked() {Log.d(TAG2, "google banner ad clicked");}
            @Override
            public void onAdLeftApplication() {Log.d(TAG2, "google banner ad left application");}
            @Override
            public void onAdClosed() {Log.d(TAG2, "google banner ad closed");}
        });
Naomanaomi answered 27/10, 2020 at 17:10 Comment(0)
P
0

I had this problem with device. My ads worked without problems with UnitID Test Emulator, but when testing on my device it doesn't work with message "failed to load ad: 3"

My solution was to test the app in the internal test environment of Google Play Console creating User Verifiers

Then I downloaded the app on the same device from Google Play internal testing and the ads worked for me, and it worked in production too

enter image description here

Pimento answered 11/12, 2020 at 5:3 Comment(0)
P
0

In my case my Android app was showing ads normally and suddenly stopped serving ads and getting "Failed to load ad: 3" My code is 100% correct and my admob account has no limitations. Finally I logged in to my adsense account which is linked to my admob and found out that adsense stopped serving ads to my app because of identity verification required.

Phobe answered 16/1, 2023 at 9:8 Comment(0)
C
-1

I was getting this error in Flutter. Check the debug console and find this command

Use.RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("")

And copy the device id from list to MobileAdTargetingInfo testDevices and it will work !!!

Coping answered 18/5, 2020 at 13:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.