Ads Setup (AppLovin MAX)

Monetization with automatic mediation.


1. Create Account

  1. Sign up at dash.applovin.com
  2. Go to AccountKeys
  3. Copy your SDK Key

2. Create Ad Units

  1. Go to MonetizeManageAd Units
  2. Create ad units and copy IDs:
    • Rewarded Video (required)
    • Interstitial (required)
    • Banner (optional)

3. Configure in Unity

  1. Open Palette > Configuration
  2. Under SDK Keys, enter:
    • SDK Key (in MAX Integration Manager)
    • Rewarded Ad Unit ID
    • Interstitial Ad Unit ID
    • Banner Ad Unit ID (optional)

Higher fill rates with multiple ad networks:

  1. Go to MonetizeManageMediation
  2. Enable: AdMob, Meta Audience Network, Unity Ads
  3. 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 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)