Implementing Unity Ads

In my last post Unity Ads (part 1) I talked about the importance of Ads, why you need them, and how you should implement them.

Step 1: Sign-Up

Make sure you have a Unity Account before you get started. You will also need a Unity Services account as well. To get one go to https://unity3d.com/services/ads to sign-up and try the free beta.


Click “Earn Money with Your Games”.


If you have never created an ad service before your dashboard will prompt you to create a new Ad Project. Do NOT create a new project.  If you create a new project you will have to link the ID that is generated from your editor to this project. Instead, we will create the Ad portion of your project in Unity’s Project Editor.


Step 2: Enable Unity Services

Now that you have an account you need to open your game in unity. In the upper right hand corner of the Editor you should see the unity services tab (if you don’t see the tab, hit the cloud icon in the upper right).


Before you can enable start using Ads you need to create a Unity Project ID so you can collect your data and view it with Unity’s Analytic Dashboard.

Select “Create” to have Unity create a Unity Project ID.


Step 3: Enable Unity Ads

After you’ve turned on services and connected generated your Unity Project ID. You should see the available services that Unity provides within the Editor. Currently Analytics and Ads are the only ones available, however multiplayer options and Cloud Build are in the pipeline for future integration and use with the editor.

Turn on Ads by clicking the “Off” toggle to “On” for Ads.


To link this project with our online portal simply click “Go to Dashboard”.


The portal for your project should now open in your browser.


Step 4: Ads Integration

Now that your project is linked to Unity Ad Services, let’s get some ads in your code. There are two types of Unity Ads:

  1. Simple
  2. Rewarded

To explain these two types, I’ll start with Rewarded. Rewarded Ads keep track of whether or not the player has skipped your ad, or has completed watching the ad. This allows the developer to then reward the player after the completion of the advertisement.

Simple Ads are ads that simply run in your application without any other interaction with your application.

Unity provides some sample code for you to run in your project, which makes it really easy to plug and play with the feature.


In order to test out your ads, make sure that the “Enable Test Mode” button is selected


Also ensure that you are building to the iOS or the Android Platform.


When you run the code the ads should look like this:


And there you have it. Integrated ads in your game!

Happy Hacking!



Why you want ads

We live in a Free to Play World where most users have grown accustomed to mobile games being free. There are a select few who are willing to pay that up front fee, but your game will already need be popular, have player support, or a good amount of attention to sell it. And of course, console games are an entirely different story.

So how do you get revenue from users who don’t want to spend any money? Ads. Advertisements allow you to have a steady revenue stream as your users play your game.

Now I know what you’re thinking: Ads are horrible, they distract from game play, they take up screen real estate, and they take away from the experience…And yes, they can – if the developer doesn’t design the game to incorporate them in an immersive, consumable way.

In this post, I’ll go over some of the main points of integrating ads into your game and how to do it in Unity’s new services. If you want to read more about it, Unity has a few articles and blog posts about best practices and tips from other indies that successfully incorporate ads in their games:

Implementing Ads Well

Don’t disrupt game play

Have you ever played a game with an annoying banner across the top for a random ad? The answer is most likely yes. one way to avoid advertisements from disrupting game play is to make the decision at the beginning of the design process that you are going to make a freemium game. Knowing that you plan on including ads during the design phase allows you to then tailor your game to strategically use ads instead of slapping them on at the last minute.

Make ads part of the experience of your game. Currently, Unity ads will play full screen and are video based. You can have simple ads or you can have advanced ads that can tell developers if users actually watched the ad or not.

Ad Incentives

To incorporate Ads into the experience of your game you can use ads with an incentive system. For example:

A user is playing your infinite runner and they die. Instead of simply showing their score and a play again button, they see a screen that shows them their score and a choice. 1) Restart and try again, or 2)Watch an ad and start from where they died.

That way, game play has not been disrupted and the ad is showing at a natural pause in the game. Also, by rewarding the player, the user doesn’t associate dying with watching ads, giving them a bad experience with your game when they die.

Don’t break the game

Be wary of adding too much power to incentives.

The incentives and rewards that players receive for watching your ad should not give them an unfair advantage for the game. If your game involves some sort of currency, the reward shouldn’t be great enough to disrupt play. Balance the frequency of showing ads. Show them too often and you’ll irritate players, which might cause them to stop playing your game all together.

How to Implement

Unity 5.2 and higher has Ads support integrated into the editor. It’s a great tool for testing your ad experience. In my next post, I’ll show you how to integrate ads the way I did with Unity Analytics here: Unity Gaming: Anayltics

Happy Hacking