Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AdMob real ads are not showing, only test ads are displayed

I have tested the ad feature on my phone. Only the test ad are show. When I replace the unit id with my which I got from AdMob, the real ads are not displayed.

What is the problem?

Here is my code:

 <string name="banner_ad_unit_id">ca-app-pub-11*************1/7********5</string>

for xml i used

  <com.google.android.gms.ads.AdView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_centerHorizontal="true"
            ads:adSize="BANNER"
            android:id="@+id/adView"
            ads:adUnitId="@string/banner_ad_unit_id">
        </com.google.android.gms.ads.AdView>

for loading ad i used

     AdView adView=(AdView)findViewById(R.id.adView);
    AdRequest adRequest= new AdRequest.Builder().setRequestAgent("android_studio:ad_template").build();

    adView.loadAd(adRequest);

In manifeast I have

    <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

. . .

  <activity android:name="com.google.android.gms.ads.AdActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
       android:theme="@android:style/Theme.Translucent"/>

But my ads do not load in the android device. Test ads are working fine. I used a real device for all of these operation. Any help please?

like image 309
hamrodoko1 doko Avatar asked Apr 12 '17 16:04

hamrodoko1 doko


People also ask

Why ads are not showing in AdMob?

Have you integrated the Google Mobile Ads SDK correctly? Take a look at the sample apps available for Android and iOS. Sample apps show how to use the Google Mobile Ads SDK to place ads into apps. Ads won't show if you haven't integrated the Google Mobile Ads SDK correctly.

Why do my apps show test ad?

The "Test Ads" label will only appear if you are loading your Ads on an enabled test device or an Android emulator. Please make sure that you have removed all code snippets for setting test devices or don't run your app on an Android emulator to avoid seeing the "Test Ad" label in your ads.

How do I know if AdMob ads are real?

The quickest way to enable testing is to use Google-provided demo ad units. These ad units are not associated with your AdMob account, so there's no risk of your account generating invalid traffic when using these ad units. Key Point: Make sure you replace these IDs with your own ad unit ID before publishing your app.

How long does it take for AdMob to show ads?

When apps are newly registered with AdMob, it typically takes up to an hour and a few ad requests to allow inventory to build. Because of this, you may not see live impressions immediately. Note: In some cases, it may take longer than an hour. Please wait 24 hours before seeking additional help.


2 Answers

Okay the things are right as far as I see here. You donot necessarily need that templete way as mention above.

The ads are not showing because you may just have registered for ads. Your ad registeration should first be verified in google servers and that service should be activated and verified properly so that the request is not made from autoPrograms. So you should wait for at least 1-2 hours. Regards.

like image 149
Sháilèndra Wregmi Avatar answered Sep 19 '22 21:09

Sháilèndra Wregmi


The issue is with your AdRequest.

Change:

AdRequest adRequest = new AdRequest.Builder().setRequestAgent("android_studio:ad_template").build();

to:

AdRequest adRequest = new AdRequest.Builder().build();

Google APIs for Android: AdRequest.Builder setRequestAgent

like image 45
Daniel Storm Avatar answered Sep 18 '22 21:09

Daniel Storm