32

Is there any AdMob dummy ids for testing purpose? Do I need to register app & get MY_AD_UNIT_ID?

3
  • What platform is this for? Android? Sep 23, 2012 at 16:15
  • You are making the call through an Activity or from XML? Sep 23, 2012 at 16:23
  • 1
    here is appId 'ca-app-pub-3940256099942544~3347511713'
    – KamDroid
    Jul 7, 2022 at 5:12

8 Answers 8

58

This is the dummy id for Banner ads.

ca-app-pub-3940256099942544/6300978111

source

49

Banner:

ca-app-pub-3940256099942544/6300978111

Interstitial:

ca-app-pub-3940256099942544/1033173712

Rewarded Video:

ca-app-pub-3940256099942544/5224354917

Native Advanced:

ca-app-pub-3940256099942544/2247696110

Native Advanced Video:

ca-app-pub-3940256099942544/1044960115

Native Express Small/Large:

ca-app-pub-3940256099942544/2793859312 
ca-app-pub-3940256099942544/2177258514

source

21

OS: Android

Mediation: Admob

For Banner Ads:

ca-app-pub-3940256099942544/6300978111

Source

For Interstitial Ads:

ca-app-pub-3940256099942544/1033173712

Source

For Admob NativeExpress Ads:

ca-app-pub-3940256099942544/1072772517

For Rewarded Video

ca-app-pub-3940256099942544/5224354917

Note:

The NativeExpressAd you'll see looks like a real one, but it's counted as a test ad. You're free to use that ad unit ID for your testing.

by Andrew Brogdon (Google Ads Team in one of his youtube comments)

enter image description here

All test Ads you can find in the actual admob github repository in the res > values > strings.xml

5
  • Hi Dinesh, Could you please help me with this. I've created an account and used my Unit ID but not getting any ad.
    – chetan
    Nov 16, 2016 at 14:36
  • Could you open a new question and put a xml and java code of ad unit..And you can tag me there. Nov 17, 2016 at 21:46
  • I've used NativeExpressAdView and using unit id of banner and it works fine. is this the proper solution? if not then i'll open a new question with code. Thanx.
    – chetan
    Nov 18, 2016 at 6:52
  • also posted a new question here: stackoverflow.com/questions/40671219/…
    – chetan
    Nov 18, 2016 at 7:06
  • Rewarded Video: ca-app-pub-3940256099942544/5224354917
    – Aldasa
    Jul 4, 2017 at 10:08
17

And sample app id for tests : ca-app-pub-3940256099942544~3347511713

1
  • 1
    Why isnt this mentioned in the documentation of AdMob when they are telling us all about the dummy TestUnit Ids !?!? Jul 24, 2023 at 16:32
7

There aren't dummy ID's per se. You need to setup the XML or the JAVA code to get test ads. To get Test Ads during testing, add the following to your XML where you have the AdView declared.

NOTE: I use just the XML code to display Ads in my app.

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:gravity="bottom|center"
    android:orientation="horizontal" >

    <com.google.ads.AdView
        android:id="@+id/adView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        ads:adSize="BANNER"
        ads:adUnitId="YOUR_AD_UNIT_ID"
        ads:loadAdOnCreate="true"
        ads:testDevices="TEST_EMULATOR, YOUR_DEVICE_ID" >
    </com.google.ads.AdView>
</LinearLayout>

To set the Test Unit (Both the emulator and your devices) from JAVA:

AdRequest adRequest = new AdRequest();
adRequest.addTestDevice(AdRequest.TEST_EMULATOR);            
adRequest.addTestDevice("test");

To get your Device ID, you can use this:

final TelephonyManager tm = (TelephonyManager)getBaseContext().getSystemService(Context.TELEPHONY_SERVICE);
String deviceid = tm.getDeviceId();

From: https://stackoverflow.com/a/9681517/450534

EDIT: Missed your second question.

Yes. You will need to register your app in your Ad-Mob account. Without that being registered, you won't be getting your Ad Unit ID and therefore, no Ads in your app either.

UPDATE: Approximately two years after posting this answer, Google added a few dummy ID's to their admob SDK. Please refer to the other better voted answers for the dummy ID's

1
  • 1
    this answer should be update, admob now offers dummy ids ca-app-pub-3940256099942544/6300978111
    – Lucem
    Aug 9, 2018 at 18:56
5

Here is an official update from google

Android

  • Banner: ca-app-pub-3940256099942544/6300978111
  • Interstitial : ca-app-pub-3940256099942544/1033173712
  • Reward Video: ca-app-pub-3940256099942544/5224354917
  • Native Advanced: ca-app-pub-3940256099942544/2247696110
  • Native Express (small): ca-app-pub-3940256099942544/2793859312
  • Native Express (large): ca-app-pub-3940256099942544/2177258514

IOS

  • Banner:ca-app-pub-3940256099942544/6300978111

  • Interstitial ca-app-pub-3940256099942544/1033173712

  • Rewarded Video ca-app-pub-3940256099942544/1712485313

  • Native Advanced ca-app-pub-3940256099942544/2247696110

  • Native Express (Small): ca-app-pub-3940256099942544/4270592515

  • Native Express(Large): ca-app-pub-3940256099942544/8897359316

Read more:

4

For RewardedVideo you can use the following one :

private static final String AD_UNIT_ID = "ca-app-pub-3940256099942544/5224354917";
private static final String APP_ID = "ca-app-pub-3940256099942544~3347511713";

how to use:

MobileAds.initialize(this, APP_ID);

mRewardedVideoAd = MobileAds.getRewardedVideoAdInstance(this);
mRewardedVideoAd.setRewardedVideoAdListener(this);
mRewardedVideoAd.loadAd(AD_UNIT_ID, new AdRequest.Builder().build());

for showing

 if (mRewardedVideoAd.isLoaded()) {
        mRewardedVideoAd.show();
  }

Hope this will help many of us!

3

Sample adMob by google

<com.google.android.gms.ads.AdView
    android:id="@+id/adView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_alignParentBottom="true"
    ads:adSize="BANNER"
    ads:adUnitId="ca-app-pub-3940256099942544/6300978111">
</com.google.android.gms.ads.AdView>
1
  • where to put these lines?
    – HDD
    Jul 15, 2020 at 20:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.