Why is Unity Ads not showing an ad in unity 5.2?

I’m using Unity 5.2, and attached the following script to the main camera:
using UnityEngine;
using UnityEngine.Advertisements;
using System.Collections;

public class Ads : MonoBehaviour {

    // Use this for initialization
    void Start() {
        ShowAd();
    }
    public void ShowAd()
    {
        if (Advertisement.IsReady())
        {
            Advertisement.Show();
        }
    }
}

Why is Unity Ads not showing an ad? What did I wrong? Thanks in advance.

I found that I needed to initialize my Advertisement before it started to work. After that, I needed to wait until my ad was ready to be displayed. Code snippet below.

81250-capture.png

UnityAds have to download the ads first and that take some time, use

IEnumerator ShowAd() {
        while (!Advertisement.IsReady()) {
            yield return null;
        }
        Advertisement.Show();
    }

to show the ad when it is downloaded

UnityAds only works if you are on mobile, in the editor it wont work ;/

In the editor it should show the default image to say that your ads are working. If this isn’t the case, check UnityAds to make sure you have the latest version, and also check if it’s compatible with Unity 5.
Also throw in some Debug.Logs, particularly in an else statement underneath, like this:

    if (Advertisement.IsReady())
             {
                 Advertisement.Show();
             }
    else{
    Debug.Log("Advertisment is not ready.");
    }

Check the docs to make sure you’ve set it up properly, make sure you’re not building with Dev Mode enabled, and make sure the little box on the Helper Script (if you’re using it) is unchecked. Pretty sure it’s something like Testing Mode.

FIXED!

After fiddling around a lot I found the solution.

In Unity Ads > click on your game > Click on your game store listing (eg the tab that has your game ID in >
Click on settings next to ad filtering > And turn "Override client test mode OFF!