Test ads

Use test ads to verify your integration works before shipping production ad units.

Once you've installed, configured your App IDs, and initialized the SDK, you're ready to display your first ad. Always start with test ads and verify your integration before switching to production ad units.

Whilst developing your app with AdMob, you'll want to make sure you use test ads rather than production ads from your Google AdMob account - otherwise your account may be disabled!

Although usage of different advert types is explained later, set the "Ad Unit ID" to a test ID during development. These intentionally small creation fragments show the matching test ID for all six ad formats; the format guides cover lifecycle and cleanup:

jsx
import {
  AppOpenAd,
  BannerAd,
  BannerAdSize,
  InterstitialAd,
  NativeAd,
  RewardedAd,
  RewardedInterstitialAd,
  TestIds,
} from 'react-native-google-mobile-ads';

// App open
const appOpenAd = AppOpenAd.createForAdRequest(TestIds.APP_OPEN);

// Banner
function TestBanner() {
  return <BannerAd unitId={TestIds.BANNER} size={BannerAdSize.BANNER} />;
}

// Interstitial
const interstitialAd = InterstitialAd.createForAdRequest(TestIds.INTERSTITIAL);

// Rewarded
const rewardedAd = RewardedAd.createForAdRequest(TestIds.REWARDED);

// Rewarded interstitial
const rewardedInterstitialAd = RewardedInterstitialAd.createForAdRequest(
  TestIds.REWARDED_INTERSTITIAL,
);

// Native creation is asynchronous.
async function loadNativeTestAd() {
  return NativeAd.createForAdRequest(TestIds.NATIVE);
}

Verify your integration

  • You should see a Test Ad label on rendered ads when using test IDs or a registered test device.
  • If ads do not appear, work through Common reasons ads do not show.
  • For deeper diagnostics, use the Ad Inspector.

Next steps

Now the basics of setting up and configuring AdMob have been explained, you can start displaying adverts to your users. The module supports six ad formats: