Page Summary
-
Using test ads during development is recommended to test clickthrough behavior without affecting account stats or charging advertisers.
-
Google-provided demo ad units offer a quick way to enable testing without risking invalid traffic on your Ad Manager account, but remember to replace them with your own ad unit IDs before publishing.
-
You can configure your device as a test device to test with production-looking ads using your own ad unit IDs.
-
iOS simulators are automatically configured as test devices.
-
When testing with mediation, you must use the enable test devices approach, and mediated ads do not render a "Test mode" label, requiring you to ensure test mode is enabled for each mediation network.
This guide explains how to receive test ads for your ads integration. It's recommended that you use test ads during development so you can test clickthrough behavior without affecting your reservation campaigns' stats or charging advertisers.
Prerequisite
- Complete Get Started .
Demo ad units
The quickest way to enable testing is to use Google-provided demo ad units. These ad units are not associated with your Ad Manager account, so there's no risk of your account generating invalid traffic when using these ad units.
Here are demo ad units that point to specific test creatives for each format:
| Ad format | Demo ad unit ID |
|---|---|
| App Open | /21775744923/example/app-open
|
| Adaptive Banner | /21775744923/example/adaptive-banner
|
| Fixed Size Banner | /21775744923/example/fixed-size-banner
|
| Interstitial | /21775744923/example/interstitial
|
| Rewarded Ads | /21775744923/example/rewarded
|
| Rewarded Interstitial | /21775744923/example/rewarded-interstitial
|
| Native | /21775744923/example/native
|
| Native Video | /21775744923/example/native-video
|
Enable test devices (Test mode)
If you want to do more rigorous testing with production-looking ads, you can now configure your device as a test device and use your own ad unit IDs that you've created in the Ad Manager UI.
Follow the steps below to add your device as a test device.
Add your test device programmatically
If you want to test ads in your app as you're developing, follow the steps below to programmatically register your test device.
- Load your ads-integrated app and make an ad request.
- Check the console for a message that looks like this:
Copy your test device ID to your clipboard.<Google> To get test ads on this device, set: GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers = @[ @" 2077ef9a63d2b398840261c8221a0c9b" ];
-
Modify your code to set the test device ID through
testDeviceIdentifiers:Swift
let testDeviceIdentifiers = [ "2077ef9a63d2b398840261c8221a0c9b" ] MobileAds . shared . requestConfiguration . testDeviceIdentifiers = testDeviceIdentifiers . swift



