Documentation
Log In
Documentation

AdMob / GAM Waterfall

👍

Full Technical Documentation

To get full documentation and samples please refer to the GitHub page.

Integration

🚧

Requirements:

Min Android SDK version - 23 (6.0, Marshmallow)

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:3.3.0"
    // Add BidMachine SDK AdMob Adapter dependency
    implementation "io.bidmachine:ads.adapters.admob:3.3.0.45"
    // Add AdMob SDK dependency
    implementation "com.google.android.gms:play-services-ads:24.3.0"
}

Initialization

Waterfall integration does not require BidMachineSdk initialization code, as it is triggered automatically as part of the MobileAds initialization.

MobileAds.initialize(context, new OnInitializationCompleteListener() {
    @Override
    public void onInitializationComplete (InitializationStatus initializationStatus){
        // Request ads
    }
});
MobileAds.initialize(context) {
    // Optionally, enable test mode and logging
    BidMachine.setTestMode(true)
    BidMachine.setLoggingEnabled(true)
}

Logging and Test Mode

BidMachine.setTestMode(true);
BidMachine.setLoggingEnabled(true);
BidMachine.setTestMode(true);
BidMachine.setLoggingEnabled(true);

❗️

Don't forget to remove setTestMode() before releasing to production!

Additional Configuration

If you need to configure additional BidMachineSdk settings, refer to the documentation.

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.

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

BidMachine.setSubjectToGDPR(<GDPR APPLIES>);
BidMachine.setSubjectToGDPR(<GDPR APPLIES>)

TCF 2.0

PreferenceManager.getDefaultSharedPreferences(this)
        .edit()
        .putInt("IABTCF_gdprApplies", <GDPR APPLIES>)
        .apply();
PreferenceManager.getDefaultSharedPreferences(this)
        .edit()
        .putInt("IABTCF_gdprApplies", <GDPR APPLIES>)
        .apply()

TCF 1.0

PreferenceManager.getDefaultSharedPreferences(this)
        .edit()
        .putString("IABConsent_SubjectToGDPR", "<GDPR APPLIES>")
        .apply();
PreferenceManager.getDefaultSharedPreferences(this)
        .edit()
        .putString("IABConsent_SubjectToGDPR", "<GDPR APPLIES>")
        .apply()

GDPR Consent String

BidMachine.setConsentConfig(..., "<GDPR CONSENT STRING>");

TCF 2.0

PreferenceManager.getDefaultSharedPreferences(this)
        .edit()
        .putString("IABTCF_TCString", "<GDPR CONSENT STRING>")
        .apply();
PreferenceManager.getDefaultSharedPreferences(this)
        .edit()
        .putString("IABTCF_TCString", "<GDPR CONSENT STRING>")
        .apply()

TCF 1.0

PreferenceManager.getDefaultSharedPreferences(this)
        .edit()
        .putString("IABConsent_ConsentString", "<GDPR CONSENT STRING>")
        .apply();
PreferenceManager.getDefaultSharedPreferences(this)
        .edit()
        .putString("IABConsent_ConsentString", "<GDPR CONSENT STRING>")
        .apply()

CCPA

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

BidMachine.setUSPrivacyString("<IAB CCPA U.S. PRIVACY STRING>");
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 and here.

PreferenceManager.getDefaultSharedPreferences(this)
        .edit()
        .putString("IABUSPrivacy_String", "<IAB CCPA U.S. PRIVACY STRING>")
        .apply();
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.

Ad Formats

Supported Ad Formats are:

  • Banner
  • Interstitial
  • Rewarded Ads
  • Native Ads

Changelog

Version 3.3.0.45 (May 29, 2025)

Features:

  • Updated BidMachine version to 3.3.0
  • Updated AdMob version to 24.3.0

Version 3.2.1.44 (May 7, 2025)

Bugfix:

  • Updated AdMob adapter to be compatible with both versions prior 24.0.0 and upper

Version 3.2.1.43 (March 27, 2025)

Features:

  • Updated Min Android SDK version to 23 due to AdMob update to 24.1.0
  • Updated AdMob version to 24.1.0

Version 3.2.1.42 (March 24, 2025)

Features:

  • Updated BidMachine version to 3.2.1
  • Improved AdMob adapter errors

Version 3.2.0.41 (February 20, 2025)

Features:

  • Updated BidMachine version to 3.2.0

Version 3.1.1.40 (January 10, 2025)

Features:

  • Added Waterfall adapter
  • Updated Native Ad integration
  • Updated AdMob version to 23.6.0