Admob

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

Download SDK

Download SDK from here: https://github.com/googleads/googleads-mobile-unity/releases

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.

Before releasing your app to production make sure to remove test mode.

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

Use new ConsentDebugSettings.Builder().addTestDeviceHashedId("33BE2250B43518CCDA7DE426D04EE231") to set this as a debug device.

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:

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

If you were using V1 of the plugin before, the old methods to get consent are not required anymore. Just use the UMP popup, and it will be automatically displayed when calling Initialize. No other code is needed.

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.

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:

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-BgAJ

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.

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.

Ad IDs

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

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.

Sign your app

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

To be able to see Admob ads, your app needs to be signed with your release key and uploaded on a test track on Google Play. You need to download your app using a test user to be able to see ads.

Minify

Make sure Minify is disabled. Admob SDK does not work if minify is turned on.

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