Three steps to your first ad.
About a dozen lines of code, in Unity or Capacitor. The SDK draws the countdown, the close button and the end card, so there's no UI to build.
- No dependenciesNo ad SDK, and no third-party code in your build.
- Open sourceMIT licensed, and small enough to read.
- In released gamesThe same player runs on iOS and Android today.
- Plays from the deviceAds download ahead, so nothing buffers.
- Nothing about playersDaily counts only. No ids, no tracking.
Or hand it to your agent
Paste this into Claude Code, or any coding agent, in your game's project. It reads a plain-text copy of this page, and asks you for what it can't know.
Integrate Indie Ads (https://indieadnetwork.com) into this game. Read https://indieadnetwork.com/llms.txt first and follow it. Ask me for my game's id and which placements I want before writing code.
Before you start
- Sign up with the form on the front page. We add your studio and your games by hand, and reply by email with your sign-in to the dashboard.
- Your game's id is the short name we give it there, like
mygame. It is in the dashboard under the game's name, and in the address of the game's pages. It is thehostbelow. - Nothing else is set up on our side. Placements are named in your code, and appear in the dashboard once a build has shown them an ad or offered one.
-
Install
From OpenUPM, so the Package Manager lists every version and offers updates. Add its registry and the package to
Packages/manifest.json:{ "scopedRegistries": [ { "name": "package.openupm.com", "url": "https://package.openupm.com", "scopes": ["com.indieadnetwork"] } ], "dependencies": { "com.indieadnetwork.sdk": "0.6.18" } }A project that already uses OpenUPM adds
com.indieadnetworkto that registry'sscopes. With the OpenUPM CLI it is one line:openupm add com.indieadnetwork.sdkOr straight from Git, with no registry: Window → Package Manager → + → Add package from git URL…
https://github.com/Indie-Ad-Network/sdk.git?path=/unityThat takes the newest code and holds it until you remove and add it again; the Package Manager shows no versions for a Git package. To hold a release, end the URL with its tag:
#v0.6.18.Add the SDK as a submodule, pinned to a release:
git submodule add https://github.com/Indie-Ad-Network/sdk.git vendor/sdk git -C vendor/sdk checkout v0.6.18Add its plugin to your
package.json, then sync:"indie-ads-capacitor": "file:vendor/sdk/capacitor"npm install && npx cap syncA web game with no Capacitor skips the plugin.
-
Start it
Once, when your game boots.
hostis your game's id, and each placement is a place in your game an ad can appear. The three addresses are the network's, the same for every game.using IndieAdNetwork; IndieAds.Init(new IndieAdsConfig { host = "mygame", rating = "4+", // your age rating: nothing rated above it is shown catalogueUrl = "https://indieadnetwork.com/catalogue.json", ingestUrl = "https://indieadnetwork.com/e", mixUrl = "https://indieadnetwork.com/mix", placements = new[] { new IndieAdPlacement { id = "FreeCoins" } }, });import { createIndieAds } from './vendor/sdk/core/index.js'; import { capacitorNative } from './vendor/sdk/capacitor/index.js'; const ads = createIndieAds({ host: 'mygame', rating: '4+', // your age rating: nothing rated above it is shown catalogue: 'https://indieadnetwork.com/catalogue.json', ingest: 'https://indieadnetwork.com/e', mix: 'https://indieadnetwork.com/mix', native: capacitorNative(), placements: { freeCoins: { maxSecs: 30 } }, }); -
Show an ad
From the tap on your offer. Give the reward when
grantedis true.bool showing = IndieAds.Show("FreeCoins", result => { if (result.granted) GiveThePlayerTheirCoins(); }); // false: nothing will show, and the callback is never called if (!showing) CarryOnWithoutAnAd();Showis false beforeInitand while another ad is up: check it, and don't wait on the callback alone.In the Editor a stand-in plays the ad in Play mode: one of the network's real videos, played by Unity, with the same callbacks and events as on a phone, so your code can be tried without a device build. Playables, and the player itself, are on a device.
const { granted } = await ads.show('freeCoins', { reward: '+50 coins' }); if (granted) giveThePlayerTheirCoins();
That's the integration. The countdown, the close button, the end card and the store button are drawn for you, in the player's language. With no ad ready a still card plays instead, so the reward never depends on there being one. A rewarded video's reward comes at its end, unless you give the placement a time of its own (minSecs, or in the dashboard): then it can be claimed from that time.
When you need it
Nothing here is needed for a first ad. Open what applies to your game.
InterstitialsAn ad between levels, with no reward
A video shows Skip after 5 seconds. Skip takes it to its end card, where ✕ appears 3 seconds later; a video that plays to its end has ✕ at once. With nothing ready it shows nothing, and your game carries on.
How long it holds the player is yours to say: minSecs on the placement (5 unless said, 15 at most), or in the dashboard under the game's Placements, with no release. Skip comes at that time, or at 12 seconds for a longer one, so the way out is never later than 15.
// at Init
new IndieAdPlacement { id = "Loading", format = IndieAdFormat.Interstitial }
// between levels: result.shown is false if nothing appeared
if (!IndieAds.Show("Loading", result => LoadTheNextLevel())) LoadTheNextLevel();
// at createIndieAds
placements: { loading: { format: 'interstitial', maxSecs: 30 } }
// between levels: shown is false if nothing appeared
const { shown } = await ads.show('loading');
A paid ad networkShare your slots between it and this one
No other ad network in your game? Skip this: call Show as above, and every slot is the network's. Keep mixUrl all the same: it says which games yours owes showings, and those are shown first.
The network asks for a share of your ad slots, set in the catalogue, and your paid network has the rest. How the share is worked out
if (IndieAds.Wants("FreeCoins")) IndieAds.Show("FreeCoins", done);
else ShowMyPaidNetworksAd();
In the Editor Wants goes by the share the catalogue asks, as if your studio owed nothing.
const { granted, via } = await ads.show('freeCoins', {
paid: () => myNetwork.showRewarded(), // resolves { granted }, or null if it has no ad
});
SoundPause your audio while an ad is up
The ad plays over your game, which keeps running under it.
IndieAds.OnShown += () => MyAudio.Pause();
IndieAds.OnHidden += () => MyAudio.Resume();
myAudio.pause();
await ads.show('freeCoins');
myAudio.resume();
Your opt-in rateHow many players chose to watch
Say when a placement's button is put in front of the player, and the dashboard shows shows over offers.
IndieAds.Offered("FreeCoins");ads.offered('freeCoins');ConsentFor players in the UK and the EEA
The law there asks for a player's agreement before anything is kept on their device for advertising. The SDK keeps ads downloaded ahead and which ads it has shown. Tell it the answer: without consent it keeps nothing, streams its ads, and remembers what it showed only until the game closes. What is kept and sent
// at Init, once your consent dialog has been answered
consent = IndieAds.CmpConsent() ?? false,
// and whenever the answer changes
IndieAds.SetConsent(IndieAds.CmpConsent() ?? false);
import { cmpConsent } from './vendor/sdk/capacitor/index.js';
const agreed = await cmpConsent(); // once your consent dialog has been answered
const ads = createIndieAds({ …, consent: agreed ?? false });
CmpConsent reads the answer from your consent platform: Google's User Messaging Platform, or any other built on the IAB's framework. It is true where the player agreed or needn't be asked, and null where no platform has said. With Google's (AdMob → Privacy & messaging):
- Publish a European regulations message for your app. It asks only the players the law covers.
- Keep "Store and/or access information on a device" in it. That is the purpose the SDK goes by.
- Name Indie Ad Network in your privacy policy, and among the message's ad partners if your platform lets you add one.
No consent platform? Ask in a dialog of your own, with a No as easy as the Yes, and pass its answer.
Which players to ask: GET https://indieadnetwork.com/where answers { "country": "FR", "ask": true } from the player's address, and keeps nothing. ask is true where the law wants the player asked; it says nothing of what they answered, which is yours to pass as consent. Offline, a time zone starting Europe/ is a fair guess.
Store listingsWhat to declare on Google Play and the App Store
What the SDK keeps and sends is on Privacy, written to be linked from your own policy. In short: counts of what was shown, with no advertising id, no id of the device or the player, and no location.
- Google Play: answer Yes to "Contains ads". Play counts interstitials and rewarded ads for other games, and for your own.
- Google Play's Data safety form, and the App Store's privacy labels: fill them in from the Privacy page. A report of an ad carries what the player typed, if they typed anything.
- No tracking prompt. The SDK reads no advertising id and follows no one between apps, so it needs no App Tracking Transparency prompt of its own.
- No SKAdNetwork ids. The SDK doesn't use SKAdNetwork: there is nothing to add to your
Info.plist. - Name Indie Ad Network in your privacy policy, with a link to indieadnetwork.com/privacy.
Test modeSee your own game's ads on your own device
Shows your own game's ads too, past the daily caps, and counts nothing. Never on in a released build.
IndieAds.SetTest(true);createIndieAds({ …, test: () => settings.debugAds });Before you ship
- Minified Android build? Add
-keep class com.indieadnetwork.sdk.** { *; }toproguard-user.txt. - Ship a copy of the catalogue as
Resources/indie-ads-catalogue.json. A first run with no connection shows it. - Turn test mode off.
- Players in the UK or the EEA? Pass their answer on consent, or nothing may be kept on their device. Consent
- Update your store listings. What to declare
- Ship a copy of the catalogue for a first run with no connection:
catalogue: [serverUrl, shippedUrl]. - Turn test mode off.
- Players in the UK or the EEA? Pass their answer on consent, or nothing may be kept on their device. Consent
- Update your store listings. What to declare
Two rules, both the stores' own. Reward watching, never installing or tapping the store button. And set your age rating, so the ads suit your game.
Go further
Your game shows ads. Now give it one of its own.
Swap ads with indies you know.
Tell us your studio and your games. It takes a minute.