Optimize initialization and ad loading
Stay organized with collections
Save and categorize content based on your preferences.
Select platform:
Android
Unity
Starting from Google Mobile Ads (GMA) SDK version 21.0.0, you can enable
optimized SDK initialization and ad loading to improve the overall
responsiveness of ads and help prevent "Application Not Responding"
(ANR) errors on your app.
This guide outlines the changes you need to make to enable these optimizations.
Requirements
- Google Mobile Ads Unity plugin version 7.2.0 or higher.
Update your Google Mobile Ads settings
The
Google Mobile Ads SDK
enables optimization by default, and instructs the SDK to
perform initialization and ad loading tasks processing on background threads.
The following flags are available for the
Google Mobile Ads SDK
settings scriptable
object:
- Disable initialization optimization
- Disable ad loading optimization
Check these settings to instruct the SDK to initialize and load ads on the main
thread:
Setting | Behavior |
Disable Optimize Initialization |
Disables optimizing the MobileAds.initialize() initialization call. |
Disable ad loading optimization
|
Optimizes ad load calls for all ad formats. |
Disables optimizing the ad loading call. |
You can access the Google Mobile Ads settings through the Unity asset menu:
Assets > Google Mobile Ads > Settings
Once selected, the settings UI appears in your Unity Editor inspector window.

Note that you can turn on one or both options in the same app.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 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\u003eThis optimization is achieved through two flags within the Google Mobile Ads settings: "Optimize Initialization" and "Optimize AdLoading", which offload time-consuming tasks to background threads.\u003c/p\u003e\n"],["\u003cp\u003eTo enable these optimizations, you need to update your Google Mobile Ads Unity plugin to version 7.2.0 or higher and adjust the settings via the Unity asset menu (Assets > Google Mobile Ads > Settings).\u003c/p\u003e\n"],["\u003cp\u003eBy default, both optimization flags are set to \u003ccode\u003efalse\u003c/code\u003e, allowing you to selectively enable them based on your app's needs.\u003c/p\u003e\n"]]],[],null,["Starting 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- Complete the [Get Started guide](/ad-manager/mobile-ads-sdk/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\nThe Google Mobile Ads SDK enables 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 Google Mobile Ads SDK settings 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."]]