---
updatedAt: 2025-11-11T02:12:58.000Z
agentTools:
  projectIndex: https://docs.bidmachine.io/v2.0/llms.txt
---

# AdMob Bidding

> 👍 Full Technical Documentation
>
> To get full documentation and samples please refer to the <a href="https://github.com/bidmachine/BidMachine-Android-admob-adapter-example">GitHub page</a>.

## Integration

> 🚧 Requirements:
>
> Min Android SDK version - 21 (5.0 Lollipop)

```java build.gradle
repositories {
    // Add BidMachine maven repository
    maven {
        name "BidMachine Ads maven repository"
        url "https://artifactory.bidmachine.io/bidmachine"
    }
}

dependencies {
    // Add BidMachine SDK dependency
    implementation "io.bidmachine:ads:2.7.0"
    // Add BidMachine SDK AdMob Adapter dependency
    implementation "io.bidmachine:ads.adapters.admob:2.7.0.36"
    // Add AdMob SDK dependency
    implementation "com.google.android.gms:play-services-ads:23.0.0"
}
```

## GDPR & CCPA

### GDPR

Publisher needs to send a boolean flag indicating if the GDPR applies to the current user.\
If so, the Publisher also needs to collect user consent prior to requesting any ad from the Exchange server. You can find more information on collecting consent [here](https://iabtechlab.com/standards/gdpr-transparency-and-consent-framework).

SDK has public methods to transfer the GDPR data. Also, SDK automatically retrieves GDPR from `SharedPreference`. If you would like to pass GDPR according to IAB standards, please add it in `SharedPreference`.

When using several data transfer methods at the same time, priority is given to the SDK public method, then TCF 2.0, then TCF 1.0.

Some adapters don't have a public API for the GDPR data to be passed to them. Such adapters will read GDPR from the `SharedPreference`.

**GDPR Applies**

```java SDK public method
BidMachine.setSubjectToGDPR(<GDPR APPLIES>);
```

```java TCF 2.0 - Example
PreferenceManager.getDefaultSharedPreferences(this)
        .edit()
        .putInt("IABTCF_gdprApplies", <GDPR APPLIES>)
        .apply();
```

```java TCF 1.0 - Example
PreferenceManager.getDefaultSharedPreferences(this)
        .edit()
        .putString("IABConsent_SubjectToGDPR", "<GDPR APPLIES>")
        .apply();
```

**GDPR Consent String**

```java SDK public method
BidMachine.setConsentConfig(..., "<GDPR CONSENT STRING>");
```

```java TCF 2.0 - Example
PreferenceManager.getDefaultSharedPreferences(this)
        .edit()
        .putString("IABTCF_TCString", "<GDPR CONSENT STRING>")
        .apply();
```

```java TCF 1.0 - Example
PreferenceManager.getDefaultSharedPreferences(this)
        .edit()
        .putString("IABConsent_ConsentString", "<GDPR CONSENT STRING>")
        .apply();
```

### CCPA

To pass CCPA U.S. Privacy String to BidMachine use:

```java SDK public method
BidMachine.setUSPrivacyString("<IAB CCPA U.S. PRIVACY STRING>");
```

Also, SDK automatically retrieves CCPA U.S. Privacy String from `SharedPreference`. If you would like to pass CCPA U.S. Privacy String according to IAB standards, please add it in `SharedPreference`. More information [here](https://github.com/InteractiveAdvertisingBureau/USPrivacy/blob/master/CCPA/US%20Privacy%20String.md) and [here](https://github.com/InteractiveAdvertisingBureau/USPrivacy/blob/master/CCPA/USP%20API.md#in-app-support).

```java Example
PreferenceManager.getDefaultSharedPreferences(this)
        .edit()
        .putString("IABUSPrivacy_String", "<IAB CCPA U.S. PRIVACY STRING>")
        .apply();
```

Some adapters don't have a public API for the CCPA U.S. Privacy String to be passed to them. Such adapters read this from the `SharedPreference`.

## SDK Configuration Sample

**Logging and Test Mode**

To enable logging and test mode, call the below methods.

```java SDK public method
BidMachine.setLoggingEnabled(true);
```

```java SDK public method
BidMachine.setTestMode(true);
```

> ❗️
>
> Don't forget to remove `setTestMode()` before releasing to production!

## Ad Format

Next, choose the ad format that best fits your app’s user experience.