Documentation Index
Fetch the complete documentation index at: https://mintlify.com/admob-plus/admob-plus/llms.txt
Use this file to discover all available pages before exploring further.
Overview
It is critical to use test ads during development so that you can click on them without charging Google advertisers. If you click on too many ads without being in test mode, you risk your account being flagged for invalid activity.Method 1: Google Demo Ad Units
The quickest way to enable testing is to use Google-provided test ad units. These ad units are not associated with your AdMob account, so there’s no risk of your account generating invalid traffic.Test Ad Unit IDs
| Ad Format | Android Demo ID | iOS Demo ID |
|---|---|---|
| App Open | ca-app-pub-3940256099942544/9257395921 | ca-app-pub-3940256099942544/5662855259 |
| Banner | ca-app-pub-3940256099942544/6300978111 | ca-app-pub-3940256099942544/2934735716 |
| Interstitial | ca-app-pub-3940256099942544/1033173712 | ca-app-pub-3940256099942544/4411468910 |
| Interstitial Video | ca-app-pub-3940256099942544/8691691433 | ca-app-pub-3940256099942544/5135589807 |
| Rewarded | ca-app-pub-3940256099942544/5224354917 | ca-app-pub-3940256099942544/1712485313 |
| Rewarded Interstitial | ca-app-pub-3940256099942544/5354046379 | ca-app-pub-3940256099942544/6978759866 |
| Native Advanced | ca-app-pub-3940256099942544/2247696110 | ca-app-pub-3940256099942544/3986624511 |
| Native Advanced Video | ca-app-pub-3940256099942544/1044960115 | ca-app-pub-3940256099942544/2521693316 |
Using Demo Ad Units
Simply use these test ad unit IDs when creating ads:Remember to replace test ad unit IDs with your production ad unit IDs before releasing your app.
Method 2: Test Device IDs
Another way to test is to register your device as a test device. This allows you to use your real ad unit IDs while still receiving test ads.Step 1: Get Your Test Device ID
Load your ads-integrated app and make an ad request. Your test device ID will be printed to the console/logcat output. Android (logcat):Step 2: Configure Test Device IDs
Add your test device ID using theconfigure() method:
Multiple Test Devices
You can register multiple test devices:Step 3: Verify Test Ads
When configured correctly, test ads will display a “Test Ad” label:- Google ads will show a “Test Ad” label centered at the top of the ad
- These ads are safe to click without risk to your account
- Test ad requests, impressions, and clicks will not appear in your account reports
Complete Example
Here’s a complete example using both methods:Environment-Based Configuration
For a production app, conditionally use test ads based on build configuration:Debugging Tips
Verify Test Mode is Active
- Load an ad in your app
- Look for the “Test Ad” label on the ad
- If you don’t see the label, check:
- Device ID is correctly copied (no spaces or extra characters)
configure()was called before loading ads- You’re testing on the correct device
Common Issues
Before Going to Production
Before releasing your app:Replace Ad Unit IDs
Replace all test ad unit IDs with your production ad unit IDs from the AdMob console.
Best Practices
Use Google’s demo ad units during initial development
Use test device IDs when testing with your real ad units
Never click on production ads, even during testing
Remove all test configurations before releasing to production
Use environment variables to switch between test and production ad units
Related
- Configuration - Configure AdMob SDK settings
- AdMob Test Ads Documentation
- How to Test Your Ads