Unity Ads
Rewarded Video
Unity C#
Mobile Game Monetization
Ad Monetization
iOS & Android

Unity Ads SDK Setup Guide: Rewarded Video Integration in C#

24 min read
Eshan Naithani

Unity Ads is Unity's built-in mobile ad network for Android and iOS games. Through the Advertisement Legacy package (com.unity.ads), Unity developers can integrate rewarded video, interstitial, and banner placements directly in C# using the UnityEngine.Advertisements namespace without installing third-party mediation frameworks.

Understanding when to use standalone Unity Ads versus a full mediation platform like Unity LevelPlay is essential before writing your integration code:

  • Direct Unity Ads Integration (com.unity.ads): Connects your game to a single demand source (the Unity Ads network). It is appropriate when maintaining existing games built on UnityEngine.Advertisements, building lightweight prototypes, or keeping native dependencies minimal with a single-network setup.
  • Mediated Integration (com.unity.services.levelplay): Connects your game to multiple demand sources (Unity Ads, Google AdMob, AppLovin, Meta Audience Network, and others) that compete for each impression through in-app bidding and waterfalls.

In this guide, you will learn how to install the com.unity.ads package, configure Android and iOS Game IDs and Ad Units, initialize the SDK in C#, and build a complete rewarded video ad manager (UnityAdsManager.cs) with readiness state tracking, UI button synchronization, duplicate-show protection, bounded retry logic, and reward verification.


Important 2026 Integration Notice

Before starting a new direct integration, review Unity's current SDK guidance:

Unity 2026 Direct Integration Notice: Unity Ads supports both direct SDK integration (com.unity.ads) and mediated integration. According to official Unity Ads documentation, starting April 1, 2026, apps using direct integration through the Advertisement Legacy package (com.unity.ads) may experience reduced ad performance following Unity Ads' transition to in-app bidding.

While direct integration remains supported and continues to serve ads, Unity recommends integrating Unity Ads as a bidding network through an ad mediation platform—such as Unity LevelPlay—for commercial production releases.


Quick Start: What You'll Build

By following this tutorial, you will implement:

  1. SDK Installation: Installing the official Advertisement Legacy package (com.unity.ads, targeting SDK v4.x / v4.21.0) via Unity Package Manager.
  2. Dashboard Configuration: Setting up platform-specific Android and iOS Game IDs and Rewarded Ad Unit IDs (Rewarded_Android and Rewarded_iOS).
  3. Asynchronous Initialization: Implementing IUnityAdsInitializationListener and initializing Advertisement.Initialize(gameId, testMode, this) safely on supported mobile platforms.
  4. Rewarded Video Lifecycle: Implementing IUnityAdsLoadListener and IUnityAdsShowListener to preload rewarded ads, synchronize UI button interactability, prevent duplicate show/load calls, and retry failed loads with exponential backoff.
  5. Verified Reward Delivery: Granting player rewards only when OnUnityAdsShowComplete returns UnityAdsShowCompletionState.COMPLETED for the expected Ad Unit ID.

Table of Contents

  1. What Is Unity Ads?
  2. Unity Ads vs LevelPlay
  3. Prerequisites
  4. Installing the Unity Ads SDK
  5. Configuring Game IDs and Ad Units
  6. Initializing Unity Ads in C#
  7. Implementing Rewarded Video Ads
  8. Reward Completion and Error Handling
  9. Testing on Android and iOS
  10. Monetization Best Practices
  11. Common Problems and Solutions
  12. Frequently Asked Questions
  13. Next Steps

1. What Is Unity Ads?

Unity Ads is an ad network built for mobile games on Android and iOS. It allows developers to monetize non-paying players by displaying video, playable, and display advertisements from advertisers bidding to acquire mobile users.

When integrated directly into a Unity project, Unity Ads uses the Advertisement Legacy package (com.unity.ads) and exposes its C# API through the UnityEngine.Advertisements namespace. Beginning with Unity Ads SDK v3.7+ and throughout v4.x (including v4.21.0), the SDK uses an explicit Initialize → Load → Show lifecycle driven by three listener interfaces:

  • IUnityAdsInitializationListener: Receives SDK startup success (OnInitializationComplete) and failure (OnInitializationFailed) events.
  • IUnityAdsLoadListener: Receives ad preload completion (OnUnityAdsAdLoaded) and load error (OnUnityAdsFailedToLoad) events for a specific Ad Unit ID.
  • IUnityAdsShowListener: Receives playback events (OnUnityAdsShowStart, OnUnityAdsShowClick, OnUnityAdsShowFailure, and OnUnityAdsShowComplete) when an ad is displayed to the player.

2. Unity Ads vs LevelPlay

One of the most common points of confusion in Unity monetization is the difference between Unity Ads (com.unity.ads) and Unity LevelPlay (com.unity.services.levelplay). They are separate packages designed for different architectures:

FeatureDirect Unity Ads (com.unity.ads)Unity LevelPlay (com.unity.services.levelplay)
Package Name (UPM)com.unity.ads (Advertisement Legacy)com.unity.services.levelplay (Ads Mediation)
C# NamespaceUnityEngine.AdvertisementsUnity.Services.LevelPlay
Demand SourcesSingle network (Unity Ads only)Multi-network mediation (Unity Ads, AdMob, AppLovin, Meta, Mintegral, etc.)
Auction MechanismDirect network requestReal-time in-app bidding + hybrid waterfall mediation
Native Dependency ManagementSelf-contained in UPM packageManaged via LevelPlay Network Manager & Mobile Dependency Resolver (EDM4U)
2026 RecommendationSuitable for maintaining legacy integrations or single-SDK prototypesRecommended by Unity for commercial production games (especially after April 1, 2026)

Important Rule — Do Not Mix Both Initialization Flows Manually: If you use Unity LevelPlay (or another mediation SDK such as AdMob or AppLovin MAX) to mediate Unity Ads, do not manually initialize Advertisement.Initialize() from com.unity.ads in your own scripts unless explicitly instructed by your mediation provider's documentation. The mediation SDK's Unity Ads adapter initializes and manages the underlying Unity Ads SDK automatically.


3. Prerequisites

Before integrating the C# scripts below, verify that your project meets these requirements:

  1. Unity Editor: Unity 2021.3 LTS, Unity 2022.3 LTS, or Unity 6 (6000.x) with Android Build Support and/or iOS Build Support installed.
  2. Active Build Target: Switch your active build platform in File > Build Settings (or Build Profiles in Unity 6) to Android or iOS. Unity Ads is only supported on Android and iOS build targets (Advertisement.isSupported returns false on standalone Windows/macOS/WebGL targets).
  3. Unity Cloud Account: A project linked in the Unity Cloud Dashboard under Monetization to obtain your Android and iOS Game IDs.
  4. Target SDK Version: This guide targets Unity Ads SDK v4.x (v4.21.0+) via the com.unity.ads package.

4. Installing the Unity Ads SDK

Install the Advertisement Legacy package through the Unity Package Manager:

  1. Open your Unity project and go to Window > Package Manager.
  2. In the top-left dropdown, select Packages: Unity Registry (or click the + icon and choose Add package by name...).
  3. Search for Advertisement Legacy (package identifier: com.unity.ads).
  4. Select the latest verified 4.x release (such as 4.21.0 or newer) and click Install (or Update if an older version is pre-installed).

Configuring Android 13+ Advertising ID Permission

Starting with Unity Ads SDK 4.4.0+, the package's Android manifest automatically includes the com.google.android.gms.permission.AD_ID permission required for Google Play devices running Android 13 (API level 33) and higher. If your game is directed at children under COPPA and Google Play's Families Policy prohibits transmitting the Advertising ID, review Unity's documentation on removing the AD_ID permission in a custom AndroidManifest.xml.

Official reference: Unity Ads SDK 4.21.0 Integration Documentation


5. Configuring Game IDs and Ad Units

In the Unity Cloud Dashboard (Monetization > Setup or Project Settings > Ad Units), locate two sets of credentials for your project:

  1. Game IDs: Every Unity project enabled for monetization receives two distinct numeric Game IDs—one for Google Play (Android) and one for the Apple App Store (iOS).
  2. Ad Unit IDs: Default projects initialized for direct Unity Ads integration create standard Ad Units per platform:
FormatDefault Android Ad Unit IDDefault iOS Ad Unit IDDescription
Rewarded VideoRewarded_AndroidRewarded_iOSOpt-in full-screen video ad that cannot be skipped and grants a reward upon completion.
InterstitialInterstitial_AndroidInterstitial_iOSFull-screen video or display ad shown at natural transition points (often skippable after 5 seconds).
BannerBanner_AndroidBanner_iOSRectangular banner view anchored to a screen edge.

Always verify the exact spelling of your Ad Unit IDs in the Unity Cloud Dashboard, as Ad Unit IDs are case-sensitive.


6. Initializing Unity Ads in C#

In Unity Ads SDK 4.x, initialization is asynchronous:

  1. Import using UnityEngine.Advertisements;.
  2. Implement IUnityAdsInitializationListener on your initializer or manager component.
  3. Verify Advertisement.isSupported so desktop or WebGL builds exit cleanly without throwing errors.
  4. Check !Advertisement.isInitialized so you do not re-initialize an already active SDK instance.
  5. Call Advertisement.Initialize(gameId, testMode, this) and wait for OnInitializationComplete() before calling Advertisement.Load().

Why You Should Not Call Load() Immediately After Initialize(): Advertisement.Initialize() completes asynchronously on a background thread. Calling Advertisement.Load() in the line immediately following Advertisement.Initialize() will fail because the SDK has not finished fetching its configuration. Always trigger your initial Load() inside OnInitializationComplete().


7. Implementing Rewarded Video Ads

Below is a complete, reusable UnityAdsManager.cs script targeting Unity Ads SDK v4.21.0+ (com.unity.ads). It implements IUnityAdsInitializationListener, IUnityAdsLoadListener, and IUnityAdsShowListener, and includes:

  • Separate Android and iOS Game IDs and Rewarded Ad Unit IDs
  • Explicit readiness tracking (isRewardedAdLoaded), loading state (isLoadingRewardedAd), and active display state (isShowingRewardedAd)
  • Protection against showing an unloaded ad or firing duplicate concurrent Show() / Load() requests
  • Automatic UI Button interactability synchronization (rewardedAdButton.interactable)
  • Strictly verified reward grants (only when placementId == rewardedAdUnitId and showCompletionState == UnityAdsShowCompletionState.COMPLETED) with a per-ad-load guard against duplicate reward grants
  • Bounded exponential backoff retries when an ad load fails, avoiding infinite rapid retry loops

Verification Note: This C# example is written against the official Unity Ads SDK 4.21.0 API specification (UnityEngine.Advertisements). Replace the placeholder Game IDs with your own Unity Cloud Dashboard credentials and verify behavior in the Unity Editor and on physical Android and iOS devices.

CSHARP
using System;
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Advertisements;

public class UnityAdsManager : MonoBehaviour, IUnityAdsInitializationListener, IUnityAdsLoadListener, IUnityAdsShowListener
{
    public static UnityAdsManager Instance { get; private set; }

    [Header("Unity Ads Game IDs (Replace with Dashboard Values)")]
    [SerializeField] private string androidGameId = "YOUR_ANDROID_GAME_ID";
    [SerializeField] private string iOSGameId = "YOUR_IOS_GAME_ID";
    [SerializeField] private bool testMode = true;

    [Header("Rewarded Ad Unit IDs")]
    [SerializeField] private string androidRewardedAdUnitId = "Rewarded_Android";
    [SerializeField] private string iOSRewardedAdUnitId = "Rewarded_iOS";

    [Header("Optional UI Button Binding")]
    [SerializeField] private Button rewardedAdButton;

    [Header("Retry Settings")]
    [SerializeField] private int maxLoadRetryAttempts = 3;
    [SerializeField] private float baseRetryDelaySeconds = 5f;

    [Header("Demo Reward Settings")]
    [SerializeField] private int demoCoinRewardAmount = 50;

    public event Action<int> OnRewardGranted;

    private string gameId;
    private string rewardedAdUnitId;

    private bool isInitializing;
    private bool isLoadingRewardedAd;
    private bool isRewardedAdLoaded;
    private bool isShowingRewardedAd;
    private bool hasGrantedRewardForCurrentAd;
    private int currentRetryAttempt;
    private Coroutine retryLoadCoroutine;

    public bool IsRewardedAdReady =>
        Advertisement.isInitialized && isRewardedAdLoaded && !isShowingRewardedAd;

    private void Awake()
    {
        if (Instance != null && Instance != this)
        {
            Destroy(gameObject);
            return;
        }

        Instance = this;
        DontDestroyOnLoad(gameObject);

        ConfigurePlatformIdentifiers();
        UpdateRewardButtonState();
    }

    private void Start()
    {
        if (rewardedAdButton != null)
        {
            rewardedAdButton.onClick.RemoveListener(ShowRewardedAd);
            rewardedAdButton.onClick.AddListener(ShowRewardedAd);
        }

        InitializeAds();
    }

    private void ConfigurePlatformIdentifiers()
    {
#if UNITY_IOS
        gameId = iOSGameId;
        rewardedAdUnitId = iOSRewardedAdUnitId;
#elif UNITY_ANDROID
        gameId = androidGameId;
        rewardedAdUnitId = androidRewardedAdUnitId;
#elif UNITY_EDITOR
        // In the Unity Editor, use the active build target's credentials
        gameId = androidGameId;
        rewardedAdUnitId = androidRewardedAdUnitId;
#else
        gameId = string.Empty;
        rewardedAdUnitId = string.Empty;
#endif
    }

    // =========================================================================
    // 1. SDK INITIALIZATION
    // =========================================================================

    public void InitializeAds()
    {
        if (!Advertisement.isSupported)
        {
            Debug.LogWarning("[UnityAdsManager] Unity Ads is not supported on the current platform.");
            UpdateRewardButtonState();
            return;
        }

        if (Advertisement.isInitialized)
        {
            LoadRewardedAd();
            return;
        }

        if (isInitializing)
        {
            return;
        }

        if (string.IsNullOrWhiteSpace(gameId) || gameId.StartsWith("YOUR_"))
        {
            Debug.LogWarning("[UnityAdsManager] Game ID is not configured for the current platform. Skipping initialization.");
            UpdateRewardButtonState();
            return;
        }

        isInitializing = true;
        Debug.Log($"[UnityAdsManager] Initializing Unity Ads SDK (Test Mode: {testMode})...");
        Advertisement.Initialize(gameId, testMode, this);
    }

    public void OnInitializationComplete()
    {
        isInitializing = false;
        currentRetryAttempt = 0;
        Debug.Log("[UnityAdsManager] Unity Ads initialization complete. Preloading rewarded ad...");
        LoadRewardedAd();
    }

    public void OnInitializationFailed(UnityAdsInitializationError error, string message)
    {
        isInitializing = false;
        UpdateRewardButtonState();
        Debug.LogError($"[UnityAdsManager] Unity Ads initialization failed: [{error}] {message}");
    }

    // =========================================================================
    // 2. LOADING REWARDED ADS
    // =========================================================================

    public void LoadRewardedAd()
    {
        if (!Advertisement.isSupported || !Advertisement.isInitialized)
        {
            return;
        }

        if (string.IsNullOrWhiteSpace(rewardedAdUnitId))
        {
            Debug.LogWarning("[UnityAdsManager] Rewarded Ad Unit ID is empty.");
            return;
        }

        if (isLoadingRewardedAd || isRewardedAdLoaded || isShowingRewardedAd)
        {
            return;
        }

        isLoadingRewardedAd = true;
        hasGrantedRewardForCurrentAd = false;
        UpdateRewardButtonState();

        Debug.Log($"[UnityAdsManager] Loading rewarded Ad Unit: {rewardedAdUnitId}");
        Advertisement.Load(rewardedAdUnitId, this);
    }

    public void OnUnityAdsAdLoaded(string placementId)
    {
        if (!string.Equals(placementId, rewardedAdUnitId, StringComparison.Ordinal))
        {
            return;
        }

        isLoadingRewardedAd = false;
        isRewardedAdLoaded = true;
        hasGrantedRewardForCurrentAd = false;
        currentRetryAttempt = 0;

        UpdateRewardButtonState();
        Debug.Log($"[UnityAdsManager] Rewarded ad loaded and ready: {placementId}");
    }

    public void OnUnityAdsFailedToLoad(string placementId, UnityAdsLoadError error, string message)
    {
        if (!string.Equals(placementId, rewardedAdUnitId, StringComparison.Ordinal))
        {
            return;
        }

        isLoadingRewardedAd = false;
        isRewardedAdLoaded = false;
        UpdateRewardButtonState();

        Debug.LogWarning($"[UnityAdsManager] Failed to load Ad Unit '{placementId}': [{error}] {message}");
        ScheduleLoadRetry();
    }

    private void ScheduleLoadRetry()
    {
        if (currentRetryAttempt >= maxLoadRetryAttempts)
        {
            Debug.LogWarning($"[UnityAdsManager] Reached maximum load retry attempts ({maxLoadRetryAttempts}). Waiting for next manual trigger.");
            return;
        }

        currentRetryAttempt++;
        float delaySeconds = baseRetryDelaySeconds * Mathf.Pow(2f, currentRetryAttempt - 1);

        if (retryLoadCoroutine != null)
        {
            StopCoroutine(retryLoadCoroutine);
        }

        retryLoadCoroutine = StartCoroutine(RetryLoadAfterDelayCoroutine(delaySeconds));
    }

    private IEnumerator RetryLoadAfterDelayCoroutine(float delaySeconds)
    {
        yield return new WaitForSecondsRealtime(delaySeconds);
        retryLoadCoroutine = null;
        LoadRewardedAd();
    }

    // =========================================================================
    // 3. SHOWING REWARDED ADS
    // =========================================================================

    public void ShowRewardedAd()
    {
        if (isShowingRewardedAd)
        {
            Debug.LogWarning("[UnityAdsManager] A rewarded ad is already being displayed. Ignoring duplicate request.");
            return;
        }

        if (!IsRewardedAdReady)
        {
            Debug.LogWarning("[UnityAdsManager] Rewarded ad is not ready yet. Requesting preload if needed.");
            if (!isLoadingRewardedAd)
            {
                currentRetryAttempt = 0;
                LoadRewardedAd();
            }
            UpdateRewardButtonState();
            return;
        }

        isShowingRewardedAd = true;
        isRewardedAdLoaded = false;
        UpdateRewardButtonState();

        Debug.Log($"[UnityAdsManager] Showing rewarded Ad Unit: {rewardedAdUnitId}");
        Advertisement.Show(rewardedAdUnitId, this);
    }

    public void OnUnityAdsShowStart(string placementId)
    {
        Debug.Log($"[UnityAdsManager] Ad playback started: {placementId}");
    }

    public void OnUnityAdsShowClick(string placementId)
    {
        Debug.Log($"[UnityAdsManager] Ad clicked by player: {placementId}");
    }

    public void OnUnityAdsShowFailure(string placementId, UnityAdsShowError error, string message)
    {
        if (!string.Equals(placementId, rewardedAdUnitId, StringComparison.Ordinal))
        {
            return;
        }

        isShowingRewardedAd = false;
        isRewardedAdLoaded = false;
        UpdateRewardButtonState();

        Debug.LogError($"[UnityAdsManager] Ad show failed for '{placementId}': [{error}] {message}");
        ScheduleLoadRetry();
    }

    public void OnUnityAdsShowComplete(string placementId, UnityAdsShowCompletionState showCompletionState)
    {
        if (!string.Equals(placementId, rewardedAdUnitId, StringComparison.Ordinal))
        {
            return;
        }

        isShowingRewardedAd = false;
        isRewardedAdLoaded = false;
        UpdateRewardButtonState();

        if (showCompletionState == UnityAdsShowCompletionState.COMPLETED)
        {
            if (!hasGrantedRewardForCurrentAd)
            {
                hasGrantedRewardForCurrentAd = true;
                Debug.Log("[UnityAdsManager] Player completed rewarded video. Granting reward.");
                GrantPlayerReward();
            }
        }
        else if (showCompletionState == UnityAdsShowCompletionState.SKIPPED)
        {
            Debug.Log("[UnityAdsManager] Player skipped the ad before completion. No reward granted.");
        }
        else
        {
            Debug.Log($"[UnityAdsManager] Ad finished with completion state: {showCompletionState}. No reward granted.");
        }

        // Preload the next rewarded ad for future opportunities
        currentRetryAttempt = 0;
        LoadRewardedAd();
    }

    // =========================================================================
    // 4. REWARD GRANT & UI SYNCHRONIZATION
    // =========================================================================

    private void GrantPlayerReward()
    {
        // Demonstration only: Replace PlayerPrefs with your production economy or inventory service
        int updatedCoins = PlayerPrefs.GetInt("UserCoins", 0) + demoCoinRewardAmount;
        PlayerPrefs.SetInt("UserCoins", updatedCoins);
        PlayerPrefs.Save();

        Debug.Log($"[UnityAdsManager] Demo reward granted: +{demoCoinRewardAmount} Coins (Total: {updatedCoins}).");
        OnRewardGranted?.Invoke(demoCoinRewardAmount);
    }

    public void AttachRewardButton(Button button)
    {
        if (rewardedAdButton != null)
        {
            rewardedAdButton.onClick.RemoveListener(ShowRewardedAd);
        }

        rewardedAdButton = button;

        if (rewardedAdButton != null)
        {
            rewardedAdButton.onClick.RemoveListener(ShowRewardedAd);
            rewardedAdButton.onClick.AddListener(ShowRewardedAd);
        }

        UpdateRewardButtonState();
    }

    private void UpdateRewardButtonState()
    {
        if (rewardedAdButton != null)
        {
            rewardedAdButton.interactable = IsRewardedAdReady;
        }
    }

    private void OnDestroy()
    {
        if (Instance == this)
        {
            Instance = null;
        }

        if (retryLoadCoroutine != null)
        {
            StopCoroutine(retryLoadCoroutine);
            retryLoadCoroutine = null;
        }

        if (rewardedAdButton != null)
        {
            rewardedAdButton.onClick.RemoveListener(ShowRewardedAd);
        }
    }
}

8. Reward Completion and Error Handling

Handling the reward lifecycle safely prevents two common player complaints: clicking a reward button that does nothing, and watching an ad without receiving a reward.

1. Checking UnityAdsShowCompletionState

When an ad finishes displaying, OnUnityAdsShowComplete(string placementId, UnityAdsShowCompletionState showCompletionState) receives one of three enum states:

  • UnityAdsShowCompletionState.COMPLETED: The player watched the video to completion. Grant the reward only in this state (after confirming placementId == rewardedAdUnitId).
  • UnityAdsShowCompletionState.SKIPPED: The player closed or skipped the ad early. Do not grant a reward.
  • UnityAdsShowCompletionState.UNKNOWN: Playback ended due to an indeterminate state. Do not grant a reward.

2. Moving Beyond PlayerPrefs in Production Economies

The GrantPlayerReward() method in UnityAdsManager.cs uses PlayerPrefs.SetInt("UserCoins", ...) strictly as a self-contained demonstration. In a production game:

  • Route the OnRewardGranted C# event to your game's dedicated currency or inventory service (such as a local encrypted save file or cloud-synced backend profile).
  • For competitive games or high-value premium currency rewards, implement Server-to-Server (S2S) redeem callbacks so your backend server validates a signed cryptographic callback from the ad network before crediting the player's account. We cover S2S reward validation in detail in LevelPlay Part 2: Rewarded Ads & S2S Validation.

3. Avoiding Infinite Load-Retry Loops

If a player loses internet connectivity or a region has no available ad inventory, OnUnityAdsFailedToLoad fires. Calling Advertisement.Load() unconditionally inside OnUnityAdsFailedToLoad creates an tight recursive loop that spams network requests and drains battery. Instead, use bounded retries with exponential backoff (such as maxLoadRetryAttempts = 3 in the example above) and allow the next natural menu transition to trigger a fresh load later.


9. Testing on Android and iOS

1. Enabling Test Mode

During development, keep testMode = true in Advertisement.Initialize(gameId, testMode, this). Test Mode serves safe placeholder creatives from Unity Ads so you can verify initialization, preloading, button state toggling, and OnUnityAdsShowComplete reward callbacks without generating invalid live traffic on your own device.

You can also force Test Mode for registered test devices in the Unity Cloud Monetization Dashboard under Testing, which overrides the client setting without requiring a code rebuild.

2. Editor Simulation vs. Physical Device Builds

  • Unity Editor Play Mode: When your build target in File > Build Settings is set to Android or iOS, hitting Play in the Unity Editor displays a simulated Unity Ads test overlay to verify your listener callbacks.
  • Physical Android & iOS Devices: Always build an .apk/.aab or Xcode project and test on physical hardware before release. Verify that video playback pauses background game audio cleanly, respects device orientation locks, and resumes the game loop without frame hitches when OnUnityAdsShowComplete fires.
  • Pre-Launch Checklist: Before uploading your release build to Google Play or the App Store, set testMode = false in your Inspector (or gate it behind #if DEVELOPMENT_BUILD || UNITY_EDITOR).

10. Monetization Best Practices

What Actually Drives Mobile Ad Performance

Avoid relying on generic "global eCPM benchmarks" or fixed revenue claims. In real mobile games, ad monetization performance varies significantly based on:

  • Player Geography: Advertiser demand and bid prices differ substantially across regions (for example, Tier 1 markets such as the US, UK, Canada, and Japan compared to emerging markets).
  • Platform & Privacy Consent: iOS users who opt out of App Tracking Transparency (ATT) or EEA/UK users who decline GDPR consent receive contextual ads rather than personalized behavioral ads, which affects bid density.
  • Ad Format & Engagement: Opt-in rewarded video ads typically command higher advertiser demand than passive banners because players actively engage with the placement.
  • Game Genre & Session Structure: Core loop length, session frequency, and how early in a session an ad is shown directly affect view-through and conversion rates.
  • Demand Availability & Mediation: Relying on a single direct network limits fill and price competition compared to running an in-app bidding auction across multiple networks.

Core Monetization Metrics and Formulas

Track your ad integration using clear, standardized formulas:

MetricFormulaWhat It Measures
Displayed ImpressionsCount of OnUnityAdsShowStart / OnAdDisplayed eventsTotal number of ads actually rendered on player screens.
Fill Rate (%)(Filled Ad Requests / Total Ad Requests) × 100Percentage of load requests that successfully return a playable ad. (Note: Dashboards may define fill rate at the request or opportunity level—always check your platform's exact definition.)
eCPM(Total Ad Revenue / Total Displayed Impressions) × 1,000Effective revenue earned per 1,000 displayed ad impressions.
ARPDAUTotal Daily Ad Revenue / Daily Active Users (DAU)Average daily ad revenue generated per active player.
Ad Engagement Rate (%)(Daily Users Who Watched ≥ 1 Ad / DAU) × 100Share of active players engaging with your ad placements (especially important for opt-in rewarded ads).
Ad Revenue per SessionTotal Daily Ad Revenue / Total Daily SessionsAverage monetization contribution of a single play session.
Retention (D1 / D7 / D30)(Users Returning on Day N / Cohort Install Count) × 100Measures whether your ad frequency is hurting long-term player retention.

Practical Placement Guidance

1. Designing Effective Rewarded Ad Placements

  • Tie Rewards to High-Intent Moments: Offer rewarded videos when players have a clear, immediate goal—such as a rewarded revive (second chance after failing a level), 2x end-of-level bonus currency, or instant energy/resource refills.
  • Keep Engagement Strictly Voluntary: Rewarded ads should always be initiated by an explicit player tap on a clearly labeled button (with a video icon and exact reward preview).
  • Balance the Economy: Ensure rewarded ad payouts feel meaningful without making In-App Purchases (IAP) obsolete. Pair daily or per-session caps on rewarded placements with your core store offerings.

2. Managing Interstitial Ad Frequency

  • Use Natural Transition Points: If you also show interstitial ads, trigger them only between completed levels or when returning to the main menu—never mid-gameplay.
  • Test Cooldowns and Onboarding Grace Periods: Rather than assuming a single universal cooldown number fits every genre, A/B test both your initial onboarding grace period (how many levels a new player completes before seeing their first interstitial) and your minimum seconds between interstitials while monitoring D1/D7 retention.

3. Direct SDK vs. Mediation Architecture

  • Bidding vs. Waterfall Mediation: In waterfall mediation, networks are queried one by one in order of historical price floors; in real-time in-app bidding, participating networks bid simultaneously in a unified auction.
  • When to Move to Mediation: For commercial games scaling across multiple countries, migrating from standalone com.unity.ads to Unity LevelPlay lets multiple ad networks compete for each impression and provides fallback demand when one network has no fill.
  • Keep Architectures Separate: If you migrate to mediation, remove standalone Advertisement.Initialize() calls and let the mediation SDK manage the Unity Ads adapter according to the official adapter documentation.

11. Common Problems and Solutions

Problem / SymptomLikely CauseRecommended Solution
SDK not initializing (OnInitializationComplete never fires)Advertisement.Initialize() was skipped because gameId was empty, the build target is unsupported, or the device has no internet connection.Check that your active build target in File > Build Settings is Android or iOS, verify the Game ID string is populated, and inspect OnInitializationFailed logs.
Invalid Game ID (INVALID_ARGUMENT on init)Passing an iOS Game ID on an Android build, including whitespace, or pasting a Project GUID instead of the numeric Monetization Game ID.Copy the exact numeric Android and iOS Game IDs from Unity Cloud > Monetization > Setup and assign them to the matching platform fields.
Rewarded ad not loading (OnUnityAdsFailedToLoad)Calling Advertisement.Load() before OnInitializationComplete() fires, or passing an invalid/disabled Ad Unit ID.Call Advertisement.Load() only after OnInitializationComplete() (or when Advertisement.isInitialized is true) and verify Rewarded_Android / Rewarded_iOS in the dashboard.
Advertisement.Show called before an ad is ready (NOT_READY)Calling Advertisement.Show() immediately after Load() without waiting for OnUnityAdsAdLoaded.Track readiness with a boolean flag set in OnUnityAdsAdLoaded and disable the UI button until the ad finishes loading.
NO_FILL error on loadUnity Ads has no active live campaign matching the device's region/profile, or the app is not yet live in the store and Test Mode is off.Enable testMode = true (or register your device as a Test Device in the Unity Cloud dashboard) during development to verify integration with test ads.
Missing Ad Unit (INVALID_ARGUMENT on load)The Ad Unit ID string in C# does not match the Ad Unit configured in the Unity Cloud dashboard (for example, using rewardedVideo instead of Rewarded_Android).Check Monetization > Ad Units in the Unity Cloud dashboard and match the exact case-sensitive Ad Unit ID per platform.
Callbacks (OnUnityAdsAdLoaded / OnUnityAdsShowComplete) not triggeredPassing null instead of this as the listener argument in Advertisement.Load(adUnitId, this) or Advertisement.Show(adUnitId, this), or destroying the MonoBehaviour mid-load.Pass the IUnityAdsLoadListener / IUnityAdsShowListener instance into Load() and Show(), and keep the manager persistent with DontDestroyOnLoad.
Reward not being granted after watching an adString mismatch in if (placementId.Equals(rewardedAdUnitId)) or checking the wrong completion state.Log placementId and showCompletionState inside OnUnityAdsShowComplete and ensure rewardedAdUnitId matches the loaded placement ID.
Ads display in Test Mode but fail in productiontestMode was left enabled or disabled without completing store links, tax/payout profiles, or app-ads.txt verification in the dashboard.Set testMode = false for release builds, link your live Google Play / App Store URLs in Unity Cloud, and host a valid app-ads.txt file on your developer domain.
Unsupported platform warning in Editor or PC buildActive build target in Unity Editor is set to Windows, macOS, Linux, or WebGL.Switch your build target to Android or iOS in File > Build Settings; guard runtime calls with if (Advertisement.isSupported).
Consent configuration issues (GDPR / CCPA / COPPA)User privacy MetaData flags were not passed to Advertisement.SetMetaData(...) before loading ads in regulated regions.Pass the user's consent preferences (such as gdpr.consent or privacy.consent) using Unity Ads MetaData prior to requesting ads, and review Unity's legal compliance documentation.

12. Frequently Asked Questions

Is Unity Ads direct integration still supported in 2026?

Yes. Direct integration via the Advertisement Legacy package (com.unity.ads) remains supported and continues to serve ads. However, Unity's documentation notes that starting April 1, 2026, apps using direct integration may experience reduced ad performance because Unity Ads has transitioned to an in-app bidding model. For commercial titles seeking multi-network competition, Unity recommends using Unity Ads as a bidder through mediation such as Unity LevelPlay.

Should I use Unity Ads or Unity LevelPlay?

Use standalone Unity Ads (com.unity.ads) if you are maintaining an existing direct integration, building a quick prototype, or only want a single SDK dependency from Unity. Use Unity LevelPlay (com.unity.services.levelplay) if you want multiple ad networks (Unity Ads, AdMob, AppLovin, Meta, Mintegral) to compete for impressions via real-time bidding and waterfall mediation.

Why are Unity rewarded ads not loading?

Common causes include calling Advertisement.Load() before OnInitializationComplete() fires, passing an Android Ad Unit ID on an iOS build (or vice versa), testing on an unsupported desktop platform build target instead of Android or iOS, having no network connectivity, or encountering a regional NO_FILL when Test Mode is disabled on an unlaunched app.

How do I reward players after a completed ad?

Implement IUnityAdsShowListener and grant the reward exclusively inside OnUnityAdsShowComplete(string placementId, UnityAdsShowCompletionState showCompletionState) after verifying both that placementId matches your rewarded Ad Unit ID and that showCompletionState == UnityAdsShowCompletionState.COMPLETED.

Can I use Unity Ads alongside AdMob?

Yes, through ad mediation. Instead of initializing both standalone SDKs independently and writing custom switching logic, use a mediation platform (such as Unity LevelPlay or Google AdMob Mediation) with the official Unity Ads adapter. When using mediation, do not manually call Advertisement.Initialize() from the standalone com.unity.ads package unless instructed by your mediation provider's documentation.

Should I preload rewarded ads?

Yes. Always call Advertisement.Load() as soon as OnInitializationComplete() fires, and trigger a fresh load after an ad finishes displaying inside OnUnityAdsShowComplete(). Preloading caches the video asset in advance so the player does not wait when tapping a rewarded button, and lets you disable the reward button until OnUnityAdsAdLoaded() confirms an ad is ready.

How can I test Unity Ads without displaying live ads?

Pass testMode: true into Advertisement.Initialize(gameId, testMode, this) during development, or enable Test Mode override for your project or test devices in the Unity Cloud Monetization dashboard. Always disable Test Mode in your code before submitting a production store build.


13. Next Steps

Once your standalone Unity Ads integration is working—or if you are ready to transition from single-network direct integration to multi-network mediation—explore these related engineering guides:

Need help integrating Unity Ads or optimizing your mobile game's monetization? Explore my Mobile Game Development Services, Unity Game Development Services, or get in touch.

Share this article

Looking to build a production-ready game?

See how I built Bird Sort Mania in 20 days using AI, or check out my full Mobile Games Portfolio to see my shipped titles on Android and iOS.

Get Practical Unity Development Insights

Technical guides on Unity performance, AI gameplay systems, mobile monetization, and game development.

Unsubscribe at any time. Your data is never shared.

Recommended Reading

More articles in Game Monetization