Construct 3 icon

Construct 3

Documentation

Mobile Advert

Published 2 Nov, 2017
1,126 words
~4-8 mins

The Mobile Advert plugin allows a game to use Admob Banner, Interstitial and Rewarded Video adverts on Android and iOS. This plugin does not provide advert services for HTML, Arcade, Desktop or Windows UWP exports.

Advert types

Construct supports the three main types of advert that AdMob provides:

Banner Advert

Displays an advert that partially overlays the bottom of the screen, the size of the advert can be specified when it's created.

Interstitial Advert

Displays a full screen advert, useful for transitioning between layouts.

Rewarded Video Advert

Similar to an interstitial advert in that it is a full screen advert. Plays a video that the user can either watch or dismiss. If the user watches the whole video then a reward payload is given.

Getting Started

Before getting start you need to complete the following steps first.

  1. Create an Admob account - see: https://support.google.com/admob/answer/7356219
  2. Create an application on Admob account - see: https://support.google.com/admob/answer/2773509
  3. Create advert units for your application

It used to be that was all you needed to get started, but now you need to do some additional setup for GDPR compliance.

  1. Go to the Admob console and select Blocking controls then at the far right EU USER CONSENT
  2. Copy your publisher ID and paste it into the mobile advert Publisher ID property
  3. Select the custom set of ad technology providers option, then on the select providers page choose up to 12 ad providers

That's all the configuration you need for now. You can create new applications and edit your advert units later if you need.

Before using adverts inside your game you need to specify your application ID, publisher ID and a privacy policy URL on the Mobile Advert object. Without these values the plugin will not be able to start. If you do not have a privacy policy yet then you can place a filler website address in it's place, but this should be replaced with your actual privacy policy before you release your game. If you have specified your details in plugins properties then the plugin will be configured and ready to go as soon as your game starts. You can check this using the "Is configured" condition.

Advert Loading

Adverts need to load over the network before you can use them. When creating an advert you can choose to "show" the advert immediately after it has loaded. However if it's more suitable for your game you can choose to load your advert ahead of time by creating the advert, but not showing it, then later displaying the advert when you need it. This will prevent your user experiencing a lag while the advert loads. Be sure to check your advert has actually loaded before trying to display it, loading times for rewarded video adverts in particular can be quite long. It's also worth remembering that you are not guaranteed to receive an advert when you request one, so take that into account when you are making your events.

Banner Advert Sizes

To display a banner advert you must specify a size for it, generally smart portrait/landscape will work for most situations but here are the specifiable sizes. Using a size that is larger than the display will prevent it from loading. Smart banner will vary in height depending on the available screen height. With a smart banner if the base image isn't wide enough to fill the screen black bars are displayed on either side.

Smart portrait

Screen width x 32/50/90

Smart landscape

Screen width x 32/50/90

Standard

320 x 50

Large

320 x 100

Medium

300 x 250

Full (tablet only)

468 x 60

Leaderboard (tablet only)

728 x 90

Mobile Advert Properties

Testing mode

Changes the displayed adverts units to testing adverts. Should be used during development.

Mobile Advert Conditions

On Banner Ready

Triggers when a banner advert has loaded.

On Video Ready

Triggers when a video advert has loaded.

On Interstitial Ready

Triggers when a interstitial advert has loaded.

On Banner Failed to Load

Triggers when a banner advert fails to load.

On Video Failed to Load

Triggers when a video advert fails to load.

On Interstitial Failed to Load

Triggers when a interstitial advert fails to load.

On Banner Shown

Triggers when a banner advert has been displayed.

On Video Complete

Triggers when a video advert has closed, and the user has been rewarded.

On Interstitial Complete

Triggers when a interstitial advert has closed.

On Configuration Complete

Triggers when the application ID has been successfully set.

On Configuration Failed

Triggers when the application ID failed to be set.

Is Showing Banner

True if a banner advert is being shown.

Is Showing Video

True if a video advert is being shown.

Is Showing Interstitial

True if a interstitial advert is being shown.

Is Banner Loaded

True if a banner advert is ready to be shown.

Is Video Loaded

True if a video advert is ready to be shown.

Is Interstitial Loaded

True if a interstitial advert is ready to be shown.

Mobile Advert Actions

Create Banner

Create a banner advert with a AdMob advert unit ID and size. Optionally show when loaded. Only one banner may be created at a time.

Create Video

Create a rewarded video advert with a AdMob advert unit ID. Optionally show when loaded. Only one video may be created at a time.

Create Interstitial

Create a interstitial advert with a AdMob advert unit ID. Optionally show when loaded. Only one interstitial may be created at a time.

Show Banner

Show a loaded banner advert. Will only display if there is a loaded banner ready.

Show Video

Show a loaded video advert. Will only display if there is a loaded video ready.

Show Interstitial

Show a loaded interstitial advert. Will only display if there is a loaded interstitial ready.

Hide Banner

Hide an active banner advert (destroys the advert). Does nothing if no banner is available.

Set Application ID

Defines the application ID.

Mobile Advert Expressions

ErrorMessage

When in a failure condition, an error message related to it.

RewardType

When in a On Video Complete condition, the type of the related reward.

RewardValue

When in a On Video Complete condition, the value of the related reward.

All Contributors

  • Nepeo's avatar
    Nepeo
    Last edited 11 Oct, 2018
    ~8,665 chars in 9 edits
  • Ashley's avatar
    Ashley
    Last edited 6 Nov, 2017
    ~1,852 chars in 1 edits