Ads Setup (AppLovin MAX)
Monetization with automatic mediation.
1. Create Account
- Sign up at dash.applovin.com
- Go to Account → Keys
- Copy your SDK Key
2. Create Ad Units
- Go to Monetize → Manage → Ad Units
- Create ad units and copy IDs:
- Rewarded Video (required)
- Interstitial (required)
- Banner (optional)
3. Configure in Unity
- Open Palette > Configuration
- Under SDK Keys, enter:
- SDK Key (in MAX Integration Manager)
- Rewarded Ad Unit ID
- Interstitial Ad Unit ID
- Banner Ad Unit ID (optional)
4. Enable Mediation (Recommended)
Higher fill rates with multiple ad networks:
- Go to Monetize → Manage → Mediation
- Enable: AdMob, Meta Audience Network, Unity Ads
- Each network requires API keys (follow MAX setup flow)
Usage
using Sorolla.Palette;
Rewarded Ads
// Check readiness before showing the Watch Ad button
bool ready = Palette.IsRewardedAdReady;
// Show
Palette.ShowRewardedAd(
onComplete: () => { /* user earned reward */ },
onFailed: () => { /* ad failed or was skipped */ }
);
Typical button handler:
public void OnWatchAdClicked()
{
if (!Palette.IsRewardedAdReady)
{
ShowMessage("Ad not available, try again in a moment");
return;
}
Palette.ShowRewardedAd(
onComplete: () =>
{
coins += 100;
UpdateUI();
},
onFailed: () => ShowMessage("Ad not available")
);
}
Interstitial Ads
// Check readiness (optional - ShowInterstitialAd no-ops if not ready)
bool ready = Palette.IsInterstitialAdReady;
Palette.ShowInterstitialAd(onComplete: () => LoadNextLevel());
Frequency-capped example:
void OnLevelComplete()
{
levelsCompleted++;
if (levelsCompleted % 3 == 0) // Every 3 levels
{
Palette.ShowInterstitialAd(onComplete: ShowNextLevel);
}
else
{
ShowNextLevel();
}
}
Banner Ads
Banner ads are configured via SorollaConfig.bannerAdUnit but the ShowBanner/HideBanner API is planned and not yet exposed. See Documentation~/api-reference.md for the current public surface.
Troubleshooting
| Issue | Solution |
|---|---|
| Ads not loading | Wait 30 sec after init, check SDK Key and Ad Unit IDs |
| Low fill rate | Enable mediation networks |
| Test ads only | Use real device, not simulator |
| Revenue not tracking | Verify Adjust token (Full mode) |