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

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

You can use this test ad unit id for testing, but you should replace it when your app is going to production.


Set the size

There are a couple of banner size you can use.

Image from

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

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

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

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

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

Image from

Typical Setup for Banner Ad

Image from

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

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

Sign In