Publishing

    Switch AdMob Test Ads to Real Ads in a Unity Game (and Why They Don’t Show Yet)

    Your Unity game shows test ads perfectly. Now it needs your own AdMob IDs, a consent message and a release build that never shows "Test Ad". Here is the switch, step by step, and what to check when real ads stay blank.

    Ronald Farkas9 min read

    Short answer: replace the Google sample App ID in Assets → Google Mobile Ads → Settings with your own App ID (the one with "~"), replace every sample ad unit ID in your ads code or config with your own ad unit IDs (the ones with "/"), remove test-device and debug settings, and publish a consent message in AdMob. If real ads still do not show, the usual reasons are that the app is not yet live and linked in AdMob, or it is still in AdMob’s app review.

    Our free AdMob ID switch tool checks the IDs you paste (test IDs left in, app and unit IDs swapped, IDs from two different accounts) and prints the exact lines to change. This guide explains what it checks and why.

    App ID vs ad unit ID

    AdMob gives every app one App ID and every ad placement an ad unit ID. They look alike and are the most common mix-up:

    • App ID: ca-app-pub-XXXXXXXXXXXXXXXX~YYYYYYYYYY (tilde). One per app per platform. It goes into the Google Mobile Ads settings, which write it into the Android manifest and the iOS Info.plist.
    • Ad unit ID: ca-app-pub-XXXXXXXXXXXXXXXX/ZZZZZZZZZZ (slash). One per placement: banner, interstitial, rewarded. It goes into the code or config that loads each ad.
    • The 16-digit number after "ca-app-pub-" is your publisher ID. It must be the same in all of them. If one differs, it was copied from another account or from the template author.
    • Android and iOS are separate apps in AdMob, so each platform has its own App ID and its own ad unit IDs.

    Recognise the test IDs

    Google’s sample IDs all use the publisher number 3940256099942544. The sample App IDs are ca-app-pub-3940256099942544~3347511713 (Android) and ca-app-pub-3940256099942544~1458002511 (iOS); the sample banner, interstitial and rewarded units share the same prefix. A search of your whole project for 3940256099942544 (scripts, scenes, prefabs and ScriptableObject assets, not just .cs files) is the fastest way to find leftovers. Zero results before a release build is the goal.

    Where the IDs live in a Unity project

    1. App ID: Assets → Google Mobile Ads → Settings. Enter the Android and iOS App IDs in their fields. This is Google’s plugin setting; without it the app crashes at start on Android or the ads never initialise.
    2. Ad unit IDs: wherever the template loads ads. In many templates that is a single settings asset or a script with constants. In HyperCodeStore templates by Ragendom and Satisvizion, all IDs are in one Monetization Settings asset.
    3. Some templates also copy the App ID into Google’s settings on their own, but only when that field is empty. If the field still holds the sample ID, it stays. Check it by hand.

    Test devices instead of test IDs

    Once your own IDs are in, keep testing on your phone as a registered test device. You then see real ads from your own units, labelled as test ads, without risk. Google’s docs are direct about the alternative: if you click too many ads without being in test mode, you risk your account being flagged for invalid activity.

    • Find your device ID in logcat (Android) or the Xcode console (iOS) after the first ad request.
    • Add it in code with RequestConfiguration.TestDeviceIds and MobileAds.SetRequestConfiguration, or in AdMob under Settings → Test devices. Emulators count as test devices automatically.
    • Remove the code-based test device list before the release build. Mediated networks do not show a "Test Ad" label, so never tap your own live ads.

    The consent message (UMP)

    Google’s EU user consent policy requires you to get consent from users in the European Economic Area and the UK before their personal data is used for ads. The Google User Messaging Platform (UMP) SDK, bundled with the Unity plugin, shows a message you design in AdMob → Privacy & messaging. Create a GDPR message there and publish it, otherwise the SDK has nothing to show. To test it outside Europe, set ConsentDebugSettings.DebugGeography to EEA on a test device; debug settings only work on test devices, so they do nothing in a release build, but remove them anyway to keep the code honest.

    Why real ads don’t show yet

    • The app is not live or not linked. AdMob reviews apps once they are published in a supported store and linked under App settings → Add app store details. Until then the app shows "Requires review".
    • App review in progress. Google says reviews typically take 2–3 days and that apps may see limited ad serving during the review.
    • A new ad unit. Newly created units can take some time before they fill. Leave them alone rather than creating new ones.
    • Wrong ID type. An App ID used as an ad unit ID (or the other way round) fails every request. Read the error message in the load-failed callback: it names the cause.
    • Missing or wrong app-ads.txt. See app-ads.txt for AdMob.
    • Account not finished. Payments and tax info do not stop ads from serving, but earnings are held until they are complete.

    Release checklist

    1. Project search for 3940256099942544 returns nothing.
    2. Your App IDs in Google Mobile Ads settings, for both platforms you ship.
    3. One publisher ID across all IDs.
    4. Test devices, verbose logging and debug geography removed.
    5. GDPR message published in AdMob Privacy & messaging, tested on a device.
    6. Privacy policy link set in the game and in the store listing.
    7. app-ads.txt live on the developer website from the listing.
    8. After launch: app linked in AdMob, review passed.

    The AdMob tool has this checklist with tick boxes. Next steps for release are the Play Console declarations for an AdMob game; placement and mediation choices are in Unity ads mediation for hypercasual games. Still looking for a game to ship? Browse Unity game templates with AdMob already wired in.

    Sources: Google Mobile Ads Unity plugin, "Get started" and "Enable test ads" (developers.google.com/admob/unity/quick-start, /test-ads); Android and iOS quick-start pages for the sample App IDs; "Get started with UMP" for Unity (developers.google.com/admob/unity/privacy); AdMob Help, "Get your app ready for review" (support.google.com/admob/answer/10564477). Last verified 27 October 2026.

    More guides