<br />

Enable test ads during development to test click behavior on ads without
charging Google advertisers. If you click many ads in production mode, your
account might be flagged for invalid activity.

You can get test ads in the following ways:

- Use one of the [test ad units](https://developers.google.com/admob/react-native/test-ads.md.txt#test_ad_units).
- Use your own ad unit and [enable test devices](https://developers.google.com/admob/react-native/test-ads.md.txt#enable_test_devices).

This guide explains how to enable test ads in your ads integration.

## Prerequisites

Before you continue, [set up Google Mobile Ads SDK for React Native](https://developers.google.com/admob/react-native/quick-start.md.txt).

## Use test ad unit IDs

To test your integration, use test ad unit IDs. These test ad unit IDs let
you test all ad formats without using your ad unit IDs.

> [!IMPORTANT]
> **Key Point:** Before publishing your app, replace these test ad unit IDs with your ad unit ID.

The following table lists the test ad units for each ad format:

### Android

| Ad format | Test ad unit ID |
|---|---|
| [App Open](https://developers.google.com/admob/react-native/app-open.md.txt) | `ca-app-pub-3940256099942544/9257395921` |
| [Banner (Anchored Adaptive)](https://developers.google.com/admob/react-native/banner.md.txt) | `ca-app-pub-3940256099942544/9214589741` |
| [Banner (Inline Adaptive)](https://developers.google.com/admob/react-native/banner.md.txt) | `ca-app-pub-3940256099942544/9214589741` |
| [Banner (Fixed Size)](https://developers.google.com/admob/react-native/banner/fixed-size.md.txt) | `ca-app-pub-3940256099942544/6300978111` |
| [Interstitial](https://developers.google.com/admob/react-native/interstitial.md.txt) | `ca-app-pub-3940256099942544/1033173712` |
| [Rewarded Ads](https://developers.google.com/admob/react-native/rewarded.md.txt) | `ca-app-pub-3940256099942544/5224354917` |
| [Rewarded Interstitial](https://developers.google.com/admob/react-native/rewarded-interstitial.md.txt) | `ca-app-pub-3940256099942544/5354046379` |
| [Native](https://developers.google.com/admob/react-native/native.md.txt) | `ca-app-pub-3940256099942544/2247696110` |
| [Native Video](https://developers.google.com/admob/react-native/native.md.txt) | `ca-app-pub-3940256099942544/1044960115` |

### iOS

| Ad format | Test ad unit ID |
|---|---|
| [App Open](https://developers.google.com/admob/react-native/app-open.md.txt) | `ca-app-pub-3940256099942544/5575463023` |
| [Banner (Anchored Adaptive)](https://developers.google.com/admob/react-native/banner.md.txt) | `ca-app-pub-3940256099942544/2435281174` |
| [Banner (Inline Adaptive)](https://developers.google.com/admob/react-native/banner.md.txt) | `ca-app-pub-3940256099942544/2435281174` |
| [Banner (Fixed Size)](https://developers.google.com/admob/react-native/banner/fixed-size.md.txt) | `ca-app-pub-3940256099942544/2934735716` |
| [Interstitial](https://developers.google.com/admob/react-native/interstitial.md.txt) | `ca-app-pub-3940256099942544/4411468910` |
| [Rewarded Ads](https://developers.google.com/admob/react-native/rewarded.md.txt) | `ca-app-pub-3940256099942544/1712485313` |
| [Rewarded Interstitial](https://developers.google.com/admob/react-native/rewarded-interstitial.md.txt) | `ca-app-pub-3940256099942544/6978759866` |
| [Native](https://developers.google.com/admob/react-native/native.md.txt) | `ca-app-pub-3940256099942544/3986624511` |
| [Native Video](https://developers.google.com/admob/react-native/native.md.txt) | `ca-app-pub-3940256099942544/2521693316` |

## Enable test devices

If you want to test ads in your app as you're developing, configure your
device as a test device. Use your ad unit IDs that you've created in
AdMob.

> [!IMPORTANT]
> **Key Point:** Android emulators and iOS simulators are automatically configured as test devices.

### Add a test device in the AdMob UI

To add a test device and test ads in your app builds non-programmatically,
use the AdMob UI. For details, see
[Add a test device](https://support.google.com/admob/answer/9691433).

> [!IMPORTANT]
> **Key Point:** Test devices start serving test ads in your app in about 15 minutes and up to 24 hours.

### Add your test device programmatically

To add your test device programmatically, follow these steps:

1. Run an app configured with Google Mobile Ads SDK for React Native.

2. Make an ad request with a test ad unit ID. For details, see
   [Use test ad units](https://developers.google.com/admob/react-native/test-ads.md.txt#test_ad_units).

3. Check the iOS console or Android Logcat output for a message similar to the
   following:

   ### Android

       I/Ads: Use RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("33BE2250B43518CCDA7DE426D04EE231"))
         to get test ads on this device.

   ### iOS

       <Google> To get test ads on this device, set:
         GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers =
         @[ @"2077ef9a63d2b398840261c8221a0c9b" ];

4. Copy your alphanumeric test device ID, for example,
   `2077ef9a63d2b398840261c8221a0c9b`.

5. Before you make an ad request, configure your test device ID:

   ```tsx
   import {setRequestConfiguration} from '@google/mobile-ads';

   setRequestConfiguration({
     testDeviceIds: ['33BE2250B43518CCDA7DE426D04EE231'],
   });
   ```

   This example adds the test device ID in the `RequestConfiguration` object.
   For details, see [`RequestConfiguration`](https://developers.google.com/admob/react-native/reference/interface/RequestConfiguration.md.txt).

   > [!IMPORTANT]
   > **Key Point:** Before you release your app, update the request configuration to remove the test device IDs.

6. Re-run your app. If successful, you see the following on these ad
   formats:

   - **Banner, interstitial, and rewarded ads** : The **Test Ad** label
     centered on the ad:


     ![](https://developers.google.com/static/admob/images/android-testad-0-admob.png)
   - **Native ads** : The string **Test Ad** in the headline asset:

     ![](https://developers.google.com/static/admob/images/native-testad-android.png)

   After you register your test device, replace the test ad unit IDs with your
   ad unit IDs.

Ads with the **Test Ad** label are safe to tap. Requests, impressions,
and clicks on test ads don't show up in your account's reports.

## Test ads with mediation

Test ad units only show ads from Google. To test your AdMob Mediation
configuration, you must [enable test devices](https://developers.google.com/admob/react-native/test-ads.md.txt#enable_test_devices).

Mediated ads don't render a **Test Ad** label. You are responsible for
enabling test ads for each mediation network. This process prevents
networks from flagging your account for invalid activity. For details, see
[Set up AdMob Mediation](https://developers.google.com/admob/react-native/mediation.md.txt).

If you aren't sure whether a mediation network adapter supports test ads,
avoid clicking ads from that network during development. To determine which
mediation network adapter served the current ad, inspect the
response info of the ad format. For details, see
[Retrieve information about the ad response](https://developers.google.com/admob/react-native/response-info.md.txt).