初期化と広告読み込みを最適化する
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Google Mobile Ads(GMA)SDK バージョン 21.0.0 から、SDK の初期化と広告読み込みの最適化を利用できるようになりました。この機能を使用すると、広告の総合的なレスポンスが改善され、アプリにおける Application Not Responding(ANR)エラーの防止に役立ちます。このガイドでは、これらの最適化を有効にするために必要な変更について説明します。
要件
- Google Mobile Ads Unity プラグイン バージョン 7.2.0 以降
Google Mobile Ads 設定を最新版にする
Google Mobile Ads SDK では、デフォルトで最適化が有効になっており、初期化と広告読み込みのタスク処理をバックグラウンド スレッドで行うよう SDK に指示します。
Google Mobile Ads SDK の設定用 ScriptableObject で使用できるフラグは次のとおりです。
- Disable initialization optimization(初期化の最適化を無効にする)
- Disable ad loading optimization(広告読み込みの最適化を無効にする)
初期化と広告読み込みをメインスレッドで行うよう SDK に指示するには、次の設定を確認します。
設定 | 動作 |
Disable Optimize Initialization(初期化の最適化を無効にする) |
MobileAds.initialize() 初期化呼び出しの最適化を無効にします。 |
Disable ad loading optimization(広告読み込みの最適化を無効にする)
|
すべての広告フォーマットの広告読み込み呼び出しを最適化します。 |
広告読み込み呼び出しの最適化を無効にします。 |
Google Mobile Ads 設定には、Unity のアセット メニューからアクセスできます。
[Assets](アセット)> [Google Mobile Ads](Google モバイル広告)> [Settings](設定)
選択すると、Unity Editor のインスペクタ ウィンドウに設定 UI が表示されます。

同じアプリ内で両方をオンにすることも、一方だけをオンにすることも可能です。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-19 UTC。
[null,null,["最終更新日 2025-08-19 UTC。"],[[["\u003cp\u003eStarting with Google Mobile Ads SDK version 21.0.0, you can optimize SDK initialization and ad loading to enhance ad responsiveness and mitigate ANR errors.\u003c/p\u003e\n"],["\u003cp\u003eThese optimizations are enabled through two flags within the Google Mobile Ads settings: \u003cstrong\u003eOptimize Initialization\u003c/strong\u003e and \u003cstrong\u003eOptimize AdLoading\u003c/strong\u003e, which offload time-consuming tasks to background threads.\u003c/p\u003e\n"],["\u003cp\u003eYou can access and modify these settings via the Unity asset menu: \u003cstrong\u003eAssets > Google Mobile Ads > Settings\u003c/strong\u003e, enabling either or both options based on your needs.\u003c/p\u003e\n"],["\u003cp\u003eBy default, both optimization flags are set to \u003ccode\u003efalse\u003c/code\u003e, requiring you to manually enable them to leverage these improvements.\u003c/p\u003e\n"]]],["Optimized SDK initialization and ad loading can be enabled in Google Mobile Ads (GMA) SDK version 21.0.0 and higher, preventing \"Application Not Responding\" (ANR) errors. To activate, update to Google Mobile Ads Unity plugin version 7.2.0 or higher. In Unity's **Assets \u003e Google Mobile Ads \u003e Settings**, enable **Optimize Initialization** and/or **Optimize AdLoading**. These settings offload initialization and ad loading to background threads. Both flags are `false` by default.\n"],null,["# Optimize initialization and ad loading\n\nSelect platform: [Android](/admob/android/optimize-initialization \"View this page for the Android platform docs.\") [Unity](/admob/unity/optimize-initialization \"View this page for the Unity platform docs.\")\n\n\u003cbr /\u003e\n\nStarting from Google Mobile Ads (GMA) SDK version 21.0.0, you can enable\noptimized SDK initialization and ad loading to improve the overall\nresponsiveness of ads and help prevent [\"Application Not Responding\"\n(ANR)](//developer.android.com/topic/performance/vitals/anr) errors on your app.\nThis guide outlines the changes you need to make to enable these optimizations.\n\nRequirements\n------------\n\n- Complete the [Get Started guide](/admob/unity/quick-start).\n\n\u003c!-- --\u003e\n\n- Google Mobile Ads Unity plugin version 7.2.0 or higher.\n\nUpdate your Google Mobile Ads settings\n--------------------------------------\n\nThe\n\nGoogle Mobile Ads SDK\n\nenables optimization by default, and instructs the SDK to\nperform initialization and ad loading tasks processing on background threads.\n\nThe following flags are available for the\n\nGoogle Mobile Ads SDK\n\nsettings scriptable\nobject:\n\n- Disable initialization optimization\n- Disable ad loading optimization\n\nCheck these settings to instruct the SDK to initialize and load ads on the main\nthread:\n\n| Setting | Behavior |\n|---------------------------------|-----------------------------------------------------------------------|------------------------------------------|\n| Disable Optimize Initialization | Disables optimizing the `MobileAds.initialize()` initialization call. |\n| Disable ad loading optimization | Optimizes ad load calls for all ad formats. | Disables optimizing the ad loading call. |\n\nYou can access the Google Mobile Ads settings through the Unity asset menu:\n\n**Assets \\\u003e Google Mobile Ads \\\u003e Settings**\n\nOnce selected, the settings UI appears in your Unity Editor inspector window.\n\nNote that you can turn on one or both options in the same app."]]