Google AdMob + Indie Exchange for Unity
Keep earning from your existing AdMob integration while reserving a share of eligible breaks for your own games or the indie traffic exchange. Your AdMob app IDs, ad units, and loading code stay in your ad manager.
SDK 0.5.3 preview · Download optional examples · Setup instructions
These are integration patterns for an existing ad manager, not complete provider SDK setups or certification of every SDK/version combination. Keep your provider's consent, initialization, loading, close, failure, and cleanup handlers. Use one shared guard for the entire ad break, including your provider's asynchronous display, so repeated taps cannot open competing ads. Call Indie Exchange on Unity's main thread; dispatch provider callbacks there when needed.
Set up Indie Exchange once
Keep your existing ad integration. Add Indie Exchange as another option at the same ad breaks.
- Add the game on Indie Exchange and copy its Game ID. Create an ad group with the formats you need.
- In the game's Advertising settings, enable each format with an overall share above 0%. Choose the public/personal split and any personal ad groups. Settings refresh on the next game launch.
- Install the Unity package, open Tools > Indie Exchange > Setup, and enter Game ID. Turn on Test Mode during development. Unity 2022.3 or newer is required; validate your target Unity version and devices.
- After your consent and age flow permits ad requests, initialize Indie Exchange and your existing provider independently. Let both preload ahead of the ad break.
using IndieExchange;
// Once, after consent allows ad requests:
IndieAds.Initialize(); Editor Test Mode displays offline samples. Device Test Mode previews eligible server creatives without exchange credits. Test your other provider using its own test mode too, then turn test modes off for release.
Add cross-promotion at your interstitial break
Place this fragment inside your existing guarded, async interstitial-break handler. interstitialAd is the GoogleMobileAds.Api.InterstitialAd your code has already loaded.
if (await IndieAds.TryShowInterstitialAsync())
return;
if (interstitialAd != null && interstitialAd.CanShowAd())
{
interstitialAd.Show();
return;
}
// AdMob has no ready ad at this break.
await IndieAds.TryShowInterstitialAsync(bypassPercentage: true); This uses the GoogleMobileAds.Api object API. Keep your existing imports and load code. If you use a different AdMob API generation, adapt its readiness/show calls using Google's documentation; the Indie Exchange calls stay the same.
Keep your Google AdMob lifecycle
Use your existing provider's callbacks to finish the break and prepare the next ad.
- Keep AdMob's close and failed-to-open handlers responsible for finishing its display attempt and loading the next ad. Dispose of spent ad objects as prescribed by Google.
- A readiness check is not a guarantee of display. To recover from a later failed-to-open callback, apply the one-attempt rule in the no-fill guide while the same break remains active.
- If AdMob mediates other networks, wait for the complete AdMob attempt to fail. Do not react separately to each mediated network's failure.
Keep one ad in charge of each break
An Indie Exchange full-screen call returns true after a displayed ad closes, including an early exit. False means it did not display an ad, so your normal provider can take over.
- Initialize and preload your normal provider independently. An Indie Exchange configuration failure or unavailable cached ad must not prevent your provider's own load or show path.
- Only attempt recovery when no ad has opened and the original break is still active. A background load failure is not a reason to interrupt the player with an ad.
- Keep your shared ad-break guard held until the selected provider closes or definitively fails before opening. Ignore stale or duplicate callbacks. Never show a second ad after a successful display.
- When both sources are unavailable, continue the game. Do not loop, wait indefinitely, or promise 100% fill.
bypassPercentage: true makes one recovery attempt using a ready Indie ad. It does not fetch an ad or override a live format set to 0%. It can increase the actual Indie share above the scheduled percentage.
Banners and rewarded ads work alongside it too
Choose one banner at a time and hide it when its screen closes. Offer rewarded ads only after the player accepts a reward, and grant the reward only from the selected provider's earned-reward callback. The shared banner and rewarded guide covers these flows.
Keep building
- Unity setup, configuration, and API guide
- No-fill recovery and failure handling
- Banner visibility and rewarded callbacks
- Official Unity SDK on GitHub