The
obvious one. Just go to the
https://www.google.com/admob/
and signup or just sign in with your Google account if you have one.
Create a
new Ad
Now,
after signing in to your AdMob account, on
https://apps.admob.com/
click the Monetize tab and click Monetize New App button.
You don't
need to have an existing game to add a new app. But if you currently have it in
one of the stores just search for it and add it. Otherwise, you'll need to add
it manually by entering the App Name and Platform which can be Android or iOS.
Now, we
need to select the ad type to display in our game. I love the interstitial ads
so I'll stick with it. But you can try other ad types too. For example the
Banner type is what we see in lots of apps and games and it typically stays on
screen and rotates different ads without
disappearing.
You can
always add more than one ad units for your game. So, if you want to display
banner and also interstitial ads, that's possible. Just repeat the steps for
another type of ad.
And
that's it. We can skip the Firebase Analytics section.
Now, just
note the App Id and Ad unit Id somewhere because we'll need those values when
we'll write the ad code in our Unity game.
Jump to
the game!
Ok. We're
done with the AdMob ad setup. Now, we can implement our ad logic in Unity.
Well..
How can we communicate with AdMob ad servers within our game? The answer is… by
using Google Mobile Ads Unity Plugin!
Google
Mobile Ads Plugin
Now, open
the downloaded file by double clicking it and Unity will display the package
importing window.
Just
leave all the files as checked and click Import.
AdManager
Now, we
need our custom logic to implement the ad displaying thing. Let's add a new C#
script and name it AdManager.
AdManager
class is reponsible for initializing the AdMob, requesting new ads and
displaying those ads when needed.