Ad Integration Not Working in Unity - Monetization Fixes

Problem: Ads are not showing in your Unity game, or you see SDK errors such as "Ad failed to load", "No fill", or "Initialization failed". Banner, interstitial, or rewarded ads do not display in the Editor, in development builds, or in a published build.

Root Cause: Ad integration failures in Unity usually come from incorrect SDK setup (missing or wrong App ID / Game ID), test vs. production configuration, build settings (e.g. architecture, stripping), or mediation/network configuration. Most issues are fixable by verifying IDs, using test mode correctly, and checking the ad provider's Unity documentation.

This guide walks you through fixing ad integration in Unity step by step. We cover Unity Ads and Google AdMob as common providers, plus verification and prevention tips.

Quick Fix Solutions

Solution 1: Verify App ID / Game ID and Initialization

Problem: Wrong or missing App ID (AdMob) or Game ID (Unity Ads) causes initialization to fail and no ads to load.

Step 1: Confirm you are using the correct ID

  • Unity Ads: In Unity Services (Window > General > Services), open your project and note the Game ID (and use the correct one for iOS vs. Android if you have separate games).
  • AdMob: In AdMob Console, create or select your app and copy the App ID (e.g. ca-app-pub-XXXXXXXXXXXXXXXX~YYYYYYYYYY). Use the correct App ID per platform if you have separate apps.

Step 2: Set the ID in Unity

  • Unity Ads: In Project Settings > Services (or the Unity Ads dashboard), ensure the Game ID is set for the correct platform (iOS/Android).
  • AdMob: In your AdMob initialization code or in the AdMob settings asset (if your SDK uses one), set the App ID. Do not use a sample/placeholder ID in release builds.

Step 3: Initialize before requesting ads

  • Call the ad provider's initialization API (e.g. Advertisement.Initialize() for Unity Ads, or AdMob's initialization) before loading or showing any ad. Many "ad failed to load" errors happen because ads are requested before initialization completes.
  • Wait for an initialization callback or a short delay after app start before loading the first ad.

Verification: Enable the provider's test/debug mode (see Solution 2) and run a development build. You should see test ads. Check the provider's dashboard or debug logs to confirm initialization succeeded.


Solution 2: Use Test Mode in Development

Problem: In development or with test devices, real ads often do not fill. Using production IDs in development can also violate ad policies.

Step 1: Enable test mode for your ad SDK

  • Unity Ads: Use test Game IDs (e.g. 1234567 for Android, 1234567 for iOS) in development so test ads always fill. Switch to your real Game ID only for store builds.
  • AdMob: Use test Ad Unit IDs (e.g. ca-app-pub-3940256099942544/1033173712 for rewarded) in development. Add your test device in AdMob and use sample IDs until you publish.

Step 2: Do not mix test and production in the same build

  • Use a build flag or define (e.g. DEVELOPMENT_BUILD or a custom symbol) to switch between test and production IDs at build time. In release builds, use only your real App ID / Game ID and production ad unit IDs.

Step 3: Check debug logs

  • Enable verbose/debug logging in the ad SDK (Unity Ads: Advertisement.debugMode = true in development; AdMob: request test ads and check Logcat/Console). Error messages often explain "no fill", "invalid ID", or "not initialized".

Verification: Run the game in the Editor or a dev build with test IDs. You should see test ads (often labeled "Test" or "Sample"). If test ads show but real ads do not in production, the issue is usually ID or fill rate (see Solution 4).


Solution 3: Fix Build and Player Settings

Problem: Wrong architecture, stripping, or API level can prevent the ad SDK from loading or initializing in built players.

Step 1: Check Android settings (if targeting Android)

  • Player Settings: Use a compatible Minimum API Level (e.g. 22 or higher; check the ad SDK's requirements). Enable Internet permission (ads require network).
  • Publishing Settings: If using IL2CPP, ensure the correct Target Architectures (ARM64 is required for many stores and some SDKs). Some ad SDKs have specific IL2CPP or stripping requirements; check release notes.
  • Scripting Backend: Mono or IL2CPP both work with most ad SDKs; if you see native crashes, try the other or update the SDK.

Step 2: Check iOS settings (if targeting iOS)

  • Player Settings: Set Target minimum iOS version per the ad SDK's requirements. Add App Transport Security or allow HTTP if the SDK documentation requires it (prefer HTTPS where possible).
  • Capabilities: Ensure the app has network access. Add any framework or capability the ad SDK lists (e.g. AdSupport for IDFA if you use it).

Step 3: Reduce code stripping if ads break in release

  • In Player Settings > Other Settings, try Managed Stripping Level = Low (or Medium) if the ad SDK uses reflection and stops working in release. Re-test after changing.

Verification: Build a development or release build and run on a real device (or emulator if supported). Check logs for "initialization", "loaded", or "failed" from the ad SDK. If initialization succeeds but ads still do not show, see Solution 4.


Solution 4: Handle "No Fill" and Load Failures

Problem: Ads sometimes do not show because the network returns "no fill" (no ad available) or a load failure. Your code may not be retrying or falling back.

Step 1: Implement load callbacks

  • Do not assume the first load request succeeds. Use the ad SDK's load callback (e.g. LoadAd() with success/failure or OnUnityAdsFailedToLoad) and log the reason (no fill, network error, invalid request).
  • If load fails, retry after a short delay (e.g. 5–30 seconds) or when the user triggers the next natural ad moment. Do not spam requests; respect the provider's policies.

Step 2: Use appropriate ad formats and placements

  • Rewarded ads usually fill better than interstitials or banners in testing. If you only need one format for a first test, try a rewarded ad with test IDs to confirm the pipeline works.
  • Ensure the placement or ad unit ID matches what is configured in the ad provider's dashboard (e.g. correct placement name for Unity Ads).

Step 3: Check mediation (if you use it)

  • If you use a mediation layer (e.g. Unity LevelPlay, AdMob Mediation), ensure all networks are configured and that your app is approved for each network. A misconfigured or disabled network can reduce fill. Test with a single network first to isolate the issue.

Verification: In test mode, you should get high fill. In production, some "no fill" is normal; your code should handle it gracefully (retry, skip, or show a different reward path) and not crash or hang.


Prevention Tips

  • Use test IDs in development and switch to production IDs only in store builds. This avoids policy issues and ensures test ads always fill.
  • Initialize once at startup and wait for success (or a timeout) before requesting ads. Do not request ads before initialization.
  • Keep the ad SDK updated; newer versions often fix compatibility with the latest Unity and OS versions.
  • Read the provider's Unity integration guide (Unity Ads, AdMob) for required settings, permissions, and best practices. Many "ads not working" issues are fixed by following the official steps exactly.

Related Problems and Links

Official documentation:

Bookmark this fix for quick reference. If ads still do not show after following these steps, double-check your Game ID / App ID and that you are testing with the correct build (test vs. production). Share this article with your dev friends if it helped.