Admob

circle-info

This implementation is compatible with the latest Admob requirements about GDPR and UMP consent popup display. The popup will be displayed automatically for all users from the EEA & UK and will not be seen by the users from other regions. Please read the following implementation instructions for more information.

Select Admob from the Settings Window

Admob Settings

Download SDK

Download SDK from here: https://github.com/googleads/googleads-mobile-unity/releasesarrow-up-right

Or press the Download Admob SDK button.

Import the SDK into your Unity project.

Test Mode

If Test Mode is checked, the default test IDs from Admob will be used not the ones from this window. Always use test mode to make sure your integration is correct.

circle-exclamation

Test Device ID

Is an md5 hash unique to your device.

To get it, run the app on your device after you installed the Admob SDK search for something like this using LogCat

That number is your Device ID.

If the Test Device ID is set if you remove test mode you will receive real ads on your device, but they will not be paid. This is the way to test your Admob integration.

The GDPR (UMP) popup will be automatically shown only to the users from the EEA and UK when the Initialize() method is called.

To be displayed the popup needs to be configured inside the Admob dashboard.

Check this video for more details:

circle-info

Once the consent popup is displayed the consent is stored locally and it will never be displayed again.

circle-exclamation

ATT (App Tracking Transparency) iOS

If you develop your app for iOS, you'll also need to configure an IDFA explainer.

Go to your Admob account at Privacy & messaging and create an IDFA explainer message.

IDFA explainer

Make sure to select your iOS app inside the apps section for the message you just created.

Finally, inside the Settings Window, you have to set the message you want the users to see.

This will look as follows on the device:

circle-info

For iOS both the GDPR and ATT popups will be shown automatically; no additional code is needed.

The behavior is as follows:

First, the AdMob consent popup will be displayed. If the consent(accept) button is pressed, the ATT popup will then be shown. If consent is not accepted, the ATT popup will not be shown, as the AdMob SDK will not collect any data from the user.

For more information read this Google group post:

https://groups.google.com/g/google-admob-ads-sdk/c/huUa7eyMTEE/m/OllKB7r-BgAJarrow-up-right

Force Geography

On your device entered as Test Device ID you can change your geography area to test the built-in UMP popup. That setting will not affect any other devices.

If you are not from the EEA you can set the geography to EEA and the popup will be displayed on your test device entered in the Settings Window.

If you are not from the EEA and you want to test the UMP popup implementation inside the editor enter any characters inside the device ID field and set the geography to EEA.

circle-info

The consent pop-up will be shown only once. If you want to see it again later inside Editor call ConsentInformation.Reset();

On-device you can reinstall the app or delete all data to show it again.

App ID

Copy and paste the app ID from the App Settings section of your Admob dashboard.

Admob App ID

Ad IDs

Copy and paste your Ad units from the Admob dashboard to the Settings Window.

Admob Ad Units
circle-info

Multiple ad units from the same ad type are not supported.

Directed for children

If your app is made for kids under the age of 13 check the box.

Save

After all settings are done, press the save button.

Preparing for build

Before building make sure to Force Resolve your Android dependencies.

Resolve Android Dependencies

Sign your app

Before building your app you must sign it with your release key.

circle-exclamation

Minify

circle-exclamation

Mediation

To implement mediation of multiple ad providers, follow the mediation section from the official Admob documentation on how to download and configure 3rd party SDKs.

Last updated