
Unity, one of the world’s most popular game engines, has partnered with Google.
More than half of the new games are based on Unity’s development engine, and the company is one of the most effective and successful game engines. A new partnership with Unity at Google will expand your ad network in Unity-based games. Especially in mobile games, the ad will be very profitable for Unity, both for Google and the new deal.
Mobile advertising makes up about 70 percent of all of digital advertising revenue. The mobile gaming industry alone was worth $50.4 billion in 2017. One out of three downloaded mobile apps is a game.
How do you get stared with ads?
Enable Ads in Unity
First, set the build targets and enable Unity Ads in the Services Panel.
- Open your game project, or create a new Unity project.
- Select Edit > Build Settings and set the platform to iOS or Android
- Enable Ads in the Unity Services window.

Once that’s done, select Window > Services. Select an Organization from the drop down menu: Click Create.

Click Ads, and enable the SDK in your project:

Add the code
- First, declare the Unity Ads namespace in the header of your script
using UnityEngine.Advertisements;
- Then, you can display an ad by calling the following method
Advertisement.Show()
Example Code
Add a button to your scene that plays an ad, then handles status and callbacks.
Step 1: Select Game Object > UI > Button to add a Button in your scene
Step 2: Add the following script to the button:
using UnityEngine;
using UnityEngine.Advertisements;
public class UnityAdsExample : MonoBehaviour
{
public void ShowRewardedAd()
{
if (Advertisement.IsReady("rewardedVideo"))
{
var options = new ShowOptions { resultCallback = HandleShowResult };
Advertisement.Show("rewardedVideo", options);
}
}
private void HandleShowResult(ShowResult result)
{
switch (result)
{
case ShowResult.Finished:
Debug.Log("The ad was successfully shown.");
//
// YOUR CODE TO REWARD THE GAMER
// Give coins etc.
break;
case ShowResult.Skipped:
Debug.Log("The ad was skipped before reaching the end.");
break;
case ShowResult.Failed:
Debug.LogError("The ad failed to be shown.");
break;
}
}
}
Then simply press the editor Play button to test the Unity Ads Button integration.Additional examples and troubleshooting can be found in our monetization documentation.
Reward Players for Watching Ads
Rewarding players can add to user engagement, resulting in higher revenue!
Typically rewarded ad implementation generally involve one or more of the following:
- In-game currency or consumables
- Extra lives at the start of the game
- Point boosts for the next round
You can reward players for completing a video ad using the HandleShowResult callback method in the example above. Be sure to check that the result is ShowResult.Finished to verify that the ad was not skipped before granting the reward.
private void HandleShowResult (ShowResult result)
if (result == ShowResult.Finished)
{
//Add code to reward your player here!
//Give coins, etc
}
Manage settings in the Ads Dashboard
Log into the Unity Ads Dashboard using your UDN Account, and locate the project for your game.

Then, select a platform (iOS or Android).

From here, you can modify placements and other game-specific settings.

Source: www.unity3d.com