# Unity Ads + Indie Exchange for Unity

> Add Indie Exchange cross-promotion to an existing Unity Ads integration, with explicit readiness, show callbacks, and no-fill handling.

If your game calls UnityEngine.Advertisements directly, keep that integration and add Indie Exchange at your existing breaks. If you access Unity Ads through LevelPlay or MAX, follow your mediation provider's guide instead.

Indie Exchange Unity SDK 0.5.3 (preview).

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.

[Download Unity package](https://indie-exchange.com/downloads/IndieExchange-0.5.3.unitypackage) | [Unity SDK on GitHub](https://github.com/samdogsoft/indie-exchange-unity)

## 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.

```csharp
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

Inside your guarded, async ad-break handler, use a ready flag maintained by your existing load callbacks. unityAdUnitId is the current platform's interstitial unit; this must already implement IUnityAdsShowListener.


```csharp
if (await IndieAds.TryShowInterstitialAsync())
    return;

if (unityInterstitialReady)
{
    unityInterstitialReady = false;
    Advertisement.Show(unityAdUnitId, this);
    return;
}

await IndieAds.TryShowInterstitialAsync(bypassPercentage: true);
```

Use UnityEngine.Advertisements. unityInterstitialReady is your own field, not an Indie Exchange or Unity Ads API. Set it only when the matching interstitial unit reports a successful load; clear it on load failure, show, and when retiring that load.

## Keep your Unity Ads lifecycle

Use your existing provider's callbacks to finish the break and prepare the next ad.

- Your IUnityAdsLoadListener handles the load result for the matching ad unit. Preserve your existing initialization and load sequence.
- Keep IUnityAdsShowListener callbacks to track opening, completion, and failure for the active break and preload the next ad.
- Recover from show failure only before an ad starts. Keep interstitial and rewarded ready flags separate.
## 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.

## Next steps

- [Unity setup and API guide](https://indie-exchange.com/docs)
- [All integration guides](https://indie-exchange.com/integrations)
- [Official Unity SDK](https://github.com/samdogsoft/indie-exchange-unity)

- [Unity Ads interstitial documentation](https://docs.unity.com/en-us/grow/ads/unity-sdk/interstitial-ads)

Human-readable page: https://indie-exchange.com/integrations/unity-ads

Provider names identify their respective products. Indie Exchange is an independent service, not an official provider integration or endorsement.
