Hello, in this tutorial, I'll show you how to add a Banner Ad using the Google AdMob Blueprint plugin.
Hello, in this tutorial, I'll show you how to add a Banner Ad using the Google AdMob Blueprint plugin.
Initialize Google Mobile Ads
Before you can start displaying ads, you'll need to initialize Google Mobile Ads using the Initialize Google Mobile Ads node.
This node will just have to be called once, so you should call it when the app starts.
There are 2 callbacks, Gma Success and Gma Initialization Failed.
Creating and Displaying Banner Ads
You can use this test ad unit id for testing, but you should replace it when your app is going to production.
ca-app-pub-3940256099942544/6300978111
Set the size
There are a couple of banner size you can use.
You can try and see the size to best fit your app. The default value is a small rectangular banner.
Set the position
There are a couple of places you can set the banner. Select the location from the drop down to see what fits your app.
Load ads
The Load Ad node has 2 callbacks, Ad Loaded and Ad Load Failed.
Click and hold on the callback pins and then drag on an empty spot. Select Add Event, then Add Custom Event to create the callback nodes.
Show Banner Ad
Once ads are loaded into the banner ad, you can display it by calling the Show Ad node and passing in the Banner Ad.
It has 1 callback, which is used to let us know when an error occurs
Typical Setup for Banner Ad
Hide Banner Ad
Sometimes you may want to temporarily hide the banner ad when some occurs in your app. You can call the Hide Ad node and pass in the banner ad.
Just remember to call the Show Ad node to display it again.