Twitter LogoFacebook Logo
Adding a Banner Ad
Learn how to use the Google AdMob Blueprint plugin for Unreal Engine to add a Banner ad.
By: King

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.

Image from Codeible.com

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.


Gma Success gets executed when it initialized Google Mobile Ads successfully. You can then use create ads to display on your app.

Gma Initialization Failed gets executed when it fails to initialize Google Mobile Ads.

Creating and Displaying Banner Ads

Once Google Mobile Ads is initialized, you can begin creating the Banner Ad.

Call the Create Banner Ad node.

Image from Codeible.com

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.

Image from Codeible.com

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.

Image from Codeible.com

Load ads

When your Banner ad is created, all you have to do now is to load it with ads. 

Call the Load Ad node and pass in the Banner Ad.

Image from Codeible.com

The Load Ad node has 2 callbacks, Ad Loaded and Ad Load Failed.


Ad Loaded gets executed when an ad is loaded into the banner ad.

Ad Load Failed gets executed when no ads are returned or when an error occurs. This can happen if your AdMob ad is new and needs traffic for more ads to show for your account.

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.

Image from Codeible.com

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.

Image from Codeible.com

It has 1 callback, which is used to let us know when an error occurs

Image from Codeible.com

Typical Setup for Banner Ad

Image from Codeible.com

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.

Image from Codeible.com

Just remember to call the Show Ad node to display it again.


Sign In