Monetizing your game while keeping players engaged is easier when you implement rewarded ads, and this Unity rewarded ads tutorial will walk you through the key steps to do just that. Rewarded ads are a player-friendly monetization strategy where users choose to watch an ad in exchange for in-game rewards, such as extra lives, coins, or premium content. This makes them less intrusive than traditional ads and can even enhance gameplay when used thoughtfully.
How to Add Rewarded Ads in Unity
Before diving into how to add rewarded ads in Unity, the first step is to set up your Unity Account, depending on your preference. Both platforms support rewarded ad formats and offer tools to track performance. Once you’ve created an account and configured your game project, you’ll need to install the appropriate SDK into your Unity project.
After setting up the SDK, it’s essential to create a rewarded ad unit. This unit will provide you with a unique ID that links your Unity game to the ad network. This ID is what the system uses to load and serve ads to your users. Once you have that ready, you’ll need to configure your ad settings within Unity to determine when and how ads should be shown to players.
Rewarded Ads Unity
Implementing rewarded ads Unity correctly means understanding your game’s user flow. Rewarded ads work best when they are offered at high-value moments—like when a player fails a level or needs extra resources. The key is to make the ad feel like an optional bonus rather than an interruption. When done right, players are more likely to engage with the ads, improving both user retention and ad revenue.
Testing is also a crucial part of the process. Use test ad IDs provided by the ad network to make sure the ads load and reward players properly. You should also make sure the reward logic is secure and only grants the reward once the full ad has been viewed.
Conclusion
Understanding how to add rewarded ads in Unity isn’t just about technical steps—it’s also about using them smartly within your game design. By integrating ads where players actually find value, you create a win-win scenario: your players stay engaged, and your game earns revenue. With this Unity rewarded ads tutorial, you’re ready to offer better experiences and increase monetization in a balanced, effective way.
Script: UnityRewarded.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Advertisements;
public class UnityRewarded : MonoBehaviour, IUnityAdsInitializationListener, IUnityAdsLoadListener, IUnityAdsShowListener
{
public string gameID = "";
public string rewardedID = "";
[SerializeField] bool _testMode = true;
// Start is called before the first frame update
void Start()
{
InitializeAds();
LoadAd();
}
public void InitializeAds()
{
if (!Advertisement.isInitialized && Advertisement.isSupported)
{
Advertisement.Initialize(gameID, _testMode, this);
}
}
public void OnInitializationComplete()
{
Debug.Log("Unity Ads initialization complete.");
}
public void OnInitializationFailed(UnityAdsInitializationError error, string message)
{
Debug.Log($"Unity Ads Initialization Failed: {error.ToString()} - {message}");
}
public void LoadAd()
{
Advertisement.Load(rewardedID, this);
}
public void OnUnityAdsAdLoaded(string adUnitId)
{
//
}
public void ShowAd()
{
Advertisement.Show(rewardedID, this);
}
public void OnUnityAdsShowComplete(string adUnitId, UnityAdsShowCompletionState showCompletionState)
{
if (adUnitId.Equals(rewardedID) && showCompletionState.Equals(UnityAdsShowCompletionState.COMPLETED))
{
Debug.Log("Unity Ads Rewarded Ad Completed");
// Grant a reward.
}
}
// Implement Load and Show Listener error callbacks:
public void OnUnityAdsFailedToLoad(string adUnitId, UnityAdsLoadError error, string message)
{
Debug.Log($"Error loading Ad Unit {adUnitId}: {error.ToString()} - {message}");
// Use the error details to determine whether to try to load another ad.
LoadAd();
}
public void OnUnityAdsShowFailure(string adUnitId, UnityAdsShowError error, string message)
{
Debug.Log($"Error showing Ad Unit {adUnitId}: {error.ToString()} - {message}");
// Use the error details to determine whether to try to load another ad.
LoadAd();
}
public void OnUnityAdsShowStart(string adUnitId) { }
public void OnUnityAdsShowClick(string adUnitId) { }
}
In this tutorial, we covered how to set up and display rewarded ads using Unity ads. If you’re planning to monetize your game through multiple platforms, you might also want to integrate Facebook Audience Network. For a step-by-step guide on doing that, check out the Facebook Rewarded Ads Unity Tutorial to learn how to implement rewarded ads specifically with Facebook in your Unity project.