広告ユニットをテストする
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
広告インスペクタは、次のテストに対応しています。
- コンテキスト内テスト: アプリの広告ユニットから広告を読み込みます。広告インスペクタを開いて、広告ユニットから行われたリクエストの詳細を確認できます。
- コンテキスト外テスト: アプリの UI に移動せずに、広告インスペクタで広告ユニットを直接テストします。複数の広告ユニットを一度にテストしたり、テスト広告リクエストを非同期で読み込んで表示したり、単一の広告ソースのテストを実施したりできます。
コンテキスト外テストを実行する場合、リクエストには、児童向け取り扱い設定、カスタム ターゲティング、ネットワーク エクストラ、さまざまなサイズなど、アプリの UI で実行するためのパラメータは含まれません。これらのリクエストには制限があるため、アプリの UI でコンテキスト内テストを使用することをおすすめします。
前提条件
続行する前に、次の操作を行います。
- 前提条件のすべての項目を完了して、Ad Manager アカウントを作成し、テストデバイスを設定し、Google Mobile Ads SDK を初期化して、最新バージョンをインストールします。
- 広告インスペクタを起動します。
テスト広告をリクエストする
広告ユニットが複数の広告フォーマットに対応している場合でも、広告インスペクタではテストするフォーマットを選択することはできません。デフォルトでは、最後にリクエストされたフォーマットが使用されます。
広告インスペクタでテスト広告をリクエストする手順は次のとおりです。詳しくは、広告インスペクタ(ベータ版)をご覧ください。
コンテキスト内:
- テストデバイスで、アプリの UI に移動して広告を読み込みます。
- 広告インスペクタを開きます。[広告ユニット] タブで、広告を読み込んだ広告ユニットを探します。
- SDK リクエストログで、リクエストしたテスト広告の詳細を確認します。
Out-of-context:
- [広告ユニット] タブで、広告ユニットをタップして [テスト広告をリクエスト] をクリックします。
- SDK リクエストログで、リクエストしたテスト広告の詳細を確認します。

広告ユニットの形式が [不明] と表示されている場合は、[テスト広告をリクエスト] がグレー表示されます。1 つの広告ユニットに対して複数のフォーマットをリクエストした場合、広告インスペクタは最後の広告ユニットを使用します。
単一の広告ソースをテストする
広告インスペクタでは、1 つの入札またはウォーターフォール広告ソースからの広告だけを配信するように、アプリ内の広告リクエストを制限できます。このアプローチでは、第三者アダプタとの統合が正しく行われていることと、広告ソースが想定どおりに配信されていることを確認できます。
単一の広告ソースをテストするには、次の手順を行います。
広告インスペクタで、[単独の広告ソースのテスト] 切り替えボタンをクリックします。[単独の広告ソースをテストする] ダイアログが表示されます。

テストする広告ソースを選択します。その後、[アプリを強制再起動] ページが表示されます。

単独の広告ソースのテスト設定は、その後に作成される広告リクエストにも適用されます。このテストは、そのセッションで以前にキャッシュされた広告には適用されません。単一の広告ソースのテストを有効にする際は、アプリを強制的に再起動することをおすすめします。このアプローチにより、指定した広告ソースの広告の代わりに配信される可能性のあるキャッシュ済みの広告が無効になります。
アプリを再起動すると、すべての広告ユニットのプレースメントには、選択した広告ソースからの広告のみが表示されます。単独の広告ソースのテストを実施している間に広告インスペクタを起動すると、次のようにテスト中の広告ソースが表示されます。

単独の広告ソースのテストモードでは、リクエストされた広告ユニットの入札またはウォーターフォールがその広告ソースで設定されているかどうかにかかわらず、すべての広告リクエストに対してその広告ソースの広告が配信されるようになります。テストしている広告ソースが広告ユニットの入札またはウォーターフォールに設定されていない場合は、次のエラー メッセージが表示されます。
Ad Unit has no applicable adapter for single ad source testing on network: AD_SOURCE_ADAPTER_CLASS_NAME
単独の広告ソースのテストを開始した後に、広告ソースが広告リクエストを配信したかどうかを確認するには、広告ユニットをタップして SDK リクエストログを表示します。広告ソースが広告の読み込みに失敗すると、Adapter failed to initialize
などのエラーを説明するエラー メッセージが表示されます。
選択した広告ソースの複数のインスタンスがウォーターフォールに追加されている場合は、広告ソースへの各呼び出しインスタンスが表示されます。このプロセスは、広告が配信されるか、広告が配信されずにウォーターフォールが終了するまでレンダリングされます。
単独の広告ソースのテストを停止する
テストを停止するには、次の手順を行います。
- 広告インスペクタで、[単独の広告ソースのテスト] の切り替えをオフにします。[単独の広告ソースのテストを停止しますか?] ダイアログが表示されます。
[テストを停止] をタップします。

成功すると、[アプリを強制再起動] に確認メッセージが表示されます。

テスト対象の広告ソースのキャッシュ済みの広告を取り消すには、テストを停止した後にアプリを強制的に再起動することをおすすめします。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-31 UTC。
[null,null,["最終更新日 2025-08-31 UTC。"],[],[],null,["Select platform: [Android](/ad-manager/mobile-ads-sdk/android/ad-inspector/test-ad-units \"View this page for the Android platform docs.\") [iOS](/ad-manager/mobile-ads-sdk/ios/ad-inspector/test-ad-units \"View this page for the iOS platform docs.\") [Unity](/ad-manager/mobile-ads-sdk/unity/ad-inspector/test-ad-units \"View this page for the Unity platform docs.\") [Flutter](/ad-manager/mobile-ads-sdk/flutter/ad-inspector/test-ad-units \"View this page for the Flutter platform docs.\")\n\n\u003cbr /\u003e\n\nAd inspector supports the following tests:\n\n- **In-context testing**: load ads from the ad units in your app. You can open ad inspector to view details on requests made from ad units.\n- **Out-of-context testing**: test your ad unit directly in ad inspector without navigating to your app's UI. You can test multiple ad units at once, asynchronously load and view your test ad requests, and perform single ad source tests.\n\nWhen running an out-of-context test, your requests don't carry the parameters\nto run in your app's UI, including child-directed treatment configuration,\ncustom targeting, network extras, and different sizes. Due to the limitation of\nthese requests, we recommend you use in-context testing in your app's UI.\n\nPrerequisites\n\nBefore you continue, do the following:\n\n- Complete all items in the initial [Prerequisites](/ad-manager/mobile-ads-sdk/android/ad-inspector#prerequisites) to create an Ad Manager account, set your test device, initialize Google Mobile Ads SDK, and install the latest version.\n- [Launch ad inspector](/ad-manager/mobile-ads-sdk/android/ad-inspector/launch-ad-inspector).\n\nRequest a test ad\n\nThough your ad unit might support multiple ad formats, ad inspector doesn't let\nyou select which format to test, and defaults to the last requested format.\n\nTo request a test ad in ad inspector, complete the following steps. For more\ndetails, see\n\n[Ad inspector (Beta)](//support.google.com/admanager/answer/7180401#ad-inspector).\n\n\n- **In-context**:\n\n 1. On a test device, navigate to your app's UI and load an ad.\n 2. Open ad inspector. In the **Ad unit** tab, find the ad unit where you loaded the ad.\n 3. In **SDK request log**, view details on your requested test ad.\n- **Out-of-context**:\n\n 1. In the **Ad unit** tab, tap on your ad unit and click **Request test ad**.\n 2. In **SDK request log**, view details on your requested test ad.\n\n| **Note:** To request a test ad, [initialize the Google Mobile Ads SDK](/ad-manager/mobile-ads-sdk/android/quick-start#initialize_the_mobile_ads_sdk) with an `Activity` context.\n\nIf the ad unit format shows **Unknown** , you see **Request test ad** greyed\nout. If you request multiple formats for\na single ad unit, ad inspector uses the last ad unit.\n\n\nTest a single ad source\n\nAd inspector can restrict ad requests in your app to serve ads from a single\nbidding or waterfall ad source. This approach lets you verify that you've\ncorrectly integrated with the third-party adapter, and the ad source serves\nas expected.\n\nTo test a single ad source, complete the following steps:\n\n1. In **Ad inspector** , click the **Single ad source test** toggle. A\n **Single ad source test** dialog appears:\n\n \u003cbr /\u003e\n\n\n2. Select an ad source to test. Afterwards, you receive the\n **Force restart app** page:\n\nThe single ad source test setting applies to any future ad requests you make.\nThis test doesn't apply to previously cached ads in that session.\nWe recommend you to force restarting your app when applying a single ad source\ntest. This approach invalidates cached ads that might display instead of\nyour chosen ad source receiving a request.\n\nAfter restarting your app, all ad unit placements attempt to show an ad from the\nselected ad source. Launching ad inspector when a single ad source test is\nactive shows the active test ad source:\n\nIn single ad source test mode, all ad requests attempt to fill with the\nselected ad source, regardless of whether that ad source was configured for\nbidding or waterfall. If the ad source you're testing is not set up for bidding\nor waterfall for the ad unit, you receive the following error message: \n\n Ad Unit has no applicable adapter for single ad source testing on network: \u003cvar translate=\"no\"\u003eAD_SOURCE_ADAPTER_CLASS_NAME\u003c/var\u003e\n\nTo verify whether the ad source filled the ad requests after you start a single\nad source test, tap an ad unit to view the SDK request log. If the ad source\nfailed to load an ad, an error message appears describing the error, such\nas `Adapter failed to initialize`.\n\nIf you've added multiple instances of the selected ad source to a waterfall, you\nsee each call instance to the ad source. This process renders until the ad is\neither filled or the waterfall ends without a fill.\n\nStop a single ad source test\n\nTo stop the test, complete the following steps:\n\n1. In **Ad inspector** , click off the **Single ad source test** toggle. The **Stop single ad source test?** dialog appears.\n2. Tap **Stop test**.\n\n\n If successful, a confirmation message appears over **Force restart app**:\n\nTo revoke cached ads for the tested ad source, we recommend you to force\nrestart the app after stopping the test."]]