10-Step Integration Guide for Unity Ads in Unity

Getting started with Unity Ads is easy!

In this guide, we’ll use the Unity Ads Helper to initialize Unity Ads and show an ad on load.

Let’s begin:

Please see the README for additional documentation on using the new Unity Ads Helper.

For more examples, take a look at this Unity Ads Demo project. The README has more details.

A video walkthrough covering Unity Ads for Android in Unity, made by Salazar, is also available.

Here’s another video tutorial for Unity Ads, available in the Unity Live Training Archive.

If you need the use of Server-to-Server Redeem Callback functionality, try out this server-side example.

NOTE: S2S Redeem Callbacks are not necessary for rewarding users (a callback method can be used instead). This is an extended feature offered as a way to confirm that users actually watched videos through to completion. You would still need to configure your server to communicate back to the app that the user should then receive a reward.

13 Likes

Thanks @unity-nikkolai for sharing with us.

Will test it

1 Like

Where do you find your game ID?

You have to publish a game before you get a game ID (missing from steps).

You’re right, creating a game ID is missing from the steps in this guide. However, you do not need to have a published game before you can create a game ID.

If you have not yet created a game in the Unity Ads Admin, select Games from the left nav panel and select the Add New Game button at the top of the Games page. Then select either iOS or Android as your release platform (you’ll create one game ID per platform that you want to support). If your game has already been published to the App Store or Google Play, enter the URL for the store page into the lookup tool.

If your game has not yet been published, you can enter the name of your game instead. See the note and hyperlink under the lookup tool.

After your game profile has been created, select Games from the left navigation panel to view your list of games. You will find your game ID listed in the same row as your game name under the Game ID column. It’s also displayed at the top of each of your game pages.

Can any one upload a complete video tutorial for using unity ads to a new project?
I am trying everything described above. But does not work. I need a immediate solution.

The files

are no longer available, where can I get it?

Those links should still work. Are you getting an error? I was able to access them, even after logging out of GitHub.

Attaching the files below, just in case there’s some reason you can’t access GitHub.

1960708–126896–UnityAdsHelper.cs (4.42 KB)
1960708–126897–UnityAdsOnLoad.cs (2.36 KB)

When integrating Unity Ads for the first time, it’s best to enable test mode. I’ve added a note to the steps above.

Ideally you want test mode enabled when you’re developing your app. Then before you build and submit it to the store, you want to disable test mode. Using Unity, you typically have Development Build enabled when developing your app, but you turn it off before submitting. So in the UnityAdsHelper script, I’ve loosely coupled the two options.

Unity Ads test mode is disabled and enabled depending on whether Development Build is disabled or enabled. However, when Development Build is enabled, you can still disabled test mode from the UnityAdsHelper options in order to see live ads with Development Build enabled.

If you are able to see ads with test mode enabled, but not able to see live ad with test mode disabled, there’s a possibility that there are no more ad campaigns available for your region.

Be sure to enable Development Build in Build Settings to allow the use of test mode for Unity Ads, and uncheck the option to “Disable Test Mode” from the UnityAdsHelper script.

got it, it seems an issue with the firewall.
Thanks

I have used this Script.

https://gist.github.com/wcoastsands/b2b8b018a0ffe07e3aee

But it works fine in Editor. But in the device nothing hapend.

Can you copy the debug output from the device to a file and post it here?

I am using your two new script. Now it Works.

Thanks

Do i need my game to be in the google play store in order to generate revenue from unity ads ?
because i’m not planning to put it on the play store

No, it doesn’t need to be on the Play Store. Where do you plan on releasing your game?

@unity-nikkolai

I’m planning a facebook game that will be on both canvas and android

Just keep in mind, Unity Ads only supports iOS and Android. It doesn’t support web or standalone desktop builds.

1 Like

Very useful, and simple, integration guide. Thanks @unity-nikkolai . One thing I have noticed, is that if there is no wi-fi the ads don’t run at all, is there a way to ensure that:

  1. Ads work using mobile networks if there is no wi-fi.
  2. Maybe adding a function that prevents the player from playing the game unless there is network coverage.

Many thanks.

My mistake, it seems to have stopped working completely, for no apparent reason?

In UnityAdsHelper.cs
what line that I add game id?