> For the complete documentation index, see [llms.txt](https://gley.gitbook.io/mobile-ads/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gley.gitbook.io/mobile-ads/setup-guide/admob.md).

# Admob

{% hint style="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.
{% endhint %}

Select **Admob** from the Settings Window

<figure><img src="https://2469794362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOutOh0qZGmeDzLYpJSsg%2Fuploads%2F2oGeHggvsepH1tkrjQfo%2Fv2-AdmobAndroid.JPG?alt=media&amp;token=9a7014d4-8d75-4b12-87e6-85a90d4835d1" alt=""><figcaption><p>Admob Settings</p></figcaption></figure>

### 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.

{% hint style="warning" %}
Before releasing your app to production make sure to remove test mode.
{% endhint %}

### 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.

### GDPR (UMP) Consent Popup

The GDPR (UMP) popup will be automatically shown **only** to the users from the EEA and UK when the [Initialize()](/mobile-ads/complete-api/initialize.md) method is called.

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

Check this video for more details:

{% embed url="<https://youtu.be/Ra7AjmP7E8M>" %}

{% hint style="info" %}
Once the consent popup is displayed the consent is stored locally and it will never be displayed again.
{% endhint %}

{% hint style="warning" %}
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.
{% endhint %}

### 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.&#x20;

<figure><img src="https://2469794362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOutOh0qZGmeDzLYpJSsg%2Fuploads%2FxqBQvcCeQW5SHGumkq2g%2Fimage_2024-01-30_160545985.png?alt=media&amp;token=6153d40b-04b0-4546-9525-146d9b69eb43" alt=""><figcaption><p>IDFA explainer</p></figcaption></figure>

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

<figure><img src="https://2469794362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOutOh0qZGmeDzLYpJSsg%2Fuploads%2FoBVWqIDBP5brNPMUmrDD%2Fimage_2024-01-30_160908733.png?alt=media&amp;token=6f815282-b501-4c9c-802c-6130d0da7681" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://2469794362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOutOh0qZGmeDzLYpJSsg%2Fuploads%2FTo0GCaN56ju8dU0nYyK4%2Fimage_2024-01-30_161153874.png?alt=media&amp;token=7929878a-3169-47b9-b1a2-a65ed4e85b2b" alt=""><figcaption></figcaption></figure>

This will look as follows on the device:

<figure><img src="https://2469794362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOutOh0qZGmeDzLYpJSsg%2Fuploads%2FT8FyjWyTn4gTSHuCZYSf%2Fv2-attDevice.jpg?alt=media&amp;token=d07af5ab-259e-44c7-a14f-663a4aa2ee88" alt=""><figcaption></figcaption></figure>

{% hint style="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-BgAJ>
{% endhint %}

### Force Geography&#x20;

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.&#x20;

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.&#x20;

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.

{% hint style="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.
{% endhint %}

### App ID

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

<figure><img src="https://2469794362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOutOh0qZGmeDzLYpJSsg%2Fuploads%2F9TBK82AggPMcLXVmnBYT%2Fv2-AdmobAppID.JPG?alt=media&amp;token=8b1110bb-62c4-4415-b19e-58ec63cd0ab8" alt=""><figcaption><p>Admob App ID</p></figcaption></figure>

### Ad IDs

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

<figure><img src="https://2469794362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOutOh0qZGmeDzLYpJSsg%2Fuploads%2FUfGmVGbZT3IBTas8FgBA%2Fv2-AdmobIDs.JPG?alt=media&amp;token=4e7ede6e-bc3c-44c8-ace2-374e5014ceb1" alt=""><figcaption><p>Admob Ad Units</p></figcaption></figure>

{% hint style="info" %}
Multiple ad units from the same ad type are not supported.
{% endhint %}

### 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.

<figure><img src="https://2469794362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOutOh0qZGmeDzLYpJSsg%2Fuploads%2FJU3kkDDwkSr3aVWj1TMH%2Fv2-ForceResolve.jpg?alt=media&amp;token=479ce3b3-4e5c-413c-924f-fd26093e9ce4" alt=""><figcaption><p>Resolve Android Dependencies</p></figcaption></figure>

### Sign your app

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

{% hint style="warning" %}
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.
{% endhint %}

### Minify

{% hint style="warning" %}
Make sure Minify is disabled. Admob SDK does not work if minify is turned on.

![](https://2469794362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOutOh0qZGmeDzLYpJSsg%2Fuploads%2Fk2zewPA6DyyTUZDKe5L4%2FDisableMinify.PNG?alt=media\&token=8cdbbddc-8ab1-429c-a8c1-b2c9621ee37a)
{% endhint %}

### 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.

{% embed url="<https://developers.google.com/admob/unity/choose-networks>" %}
