Optimize initialization and ad loading
Stay organized with collections
Save and categorize content based on your preferences.
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-04-25 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-04-25 UTC."],[[["Starting 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."],["These optimizations are enabled through two flags within the Google Mobile Ads settings: **Optimize Initialization** and **Optimize AdLoading**, which offload time-consuming tasks to background threads."],["You can access and modify these settings via the Unity asset menu: **Assets \\\u003e Google Mobile Ads \\\u003e Settings**, enabling either or both options based on your needs."],["By default, both optimization flags are set to `false`, requiring you to manually enable them to leverage these improvements."]]],["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"]]