Unity Ads experience. Week 0 – Up and running

Hi, guys!

I decided to start a feedback micro tutorial of using Unity Ads with my Android app. Inside of it I’ll post weekly updates with advertisement statistics and Unity’s pros and cons.

unity ads experience

So, I created a simple endless runner 2D game using Unity3d 5.3. I integrated it with Unity Ads and published to Google Play. Let’s see what would be the result.

For now let’s look through initial benefits and weaknesses of Unity Ads.

Unity Ads benefits

First of all, I want to mention the first benefit of Unity Ads – integration simplicity. Since Unity 5.2.x it is embedded inside of the Unity Editor.

It’s even hard to imagine, that Ads integration could work in just couple of lines of code. I can show my AdManager class to prove it.

using UnityEngine;
using System.Collections;
using UnityEngine.Advertisements;

public class AdManager : MonoBehaviour {

	public string androidGameID = "<MY_APP_ID_HERE>";

	void Start () {
		Advertisement.Initialize (androidGameID, true);
		StartCoroutine (ShowAdWhenReady());
	}

	IEnumerator ShowAdWhenReady(){
		while (!Advertisement.IsReady("video"))
			yield return null;
		Debug.Log ("ready");
	}

	public void Show() {
		Advertisement.Show ("video");
	}
}

Next… Configuration is also simple. You need to create accound and register application in Unity Ads admin console. Then you will have a game ID (an integer number), that you need to use in code for integration.

There is also a possibility to specify if your app is not published yet. Then when you publish it don’t forget to bind the real app in the console.

Test mode is also a great feature. It allows you to see if ads are working (or not) in the editor’s Game mode. If it works, you should know that advertisement would work correctly in the production app.

The first trouble. Real Ads not shown.

The Test mode, that I mentioned above, brought me the first trouble.

You probably know, that you editor has a connection to Unity server. And if you change state of connected services locally, it will be applied on the server.

I had a Test mode turned ON in my editor. And this was the reason that real ads were not shown (only the stub ones). There are two solutions for this:

  1. Just disable the Test mode locally.
  2. Choose the option to override client’s test mode in the admin-panel

unity ads test mode override

In next article I will report the results of Week 1, and you will see some real statistics.

Leave a Reply

Be the First to Comment!