Skip to main content

Google Ad Manager Waterfall

Full Technical Documentation

To get full documentation and samples please refer to the GitHub Android or iOS.

Integration

Android

info

Min Android SDK version - 21 (6.0, Marshmallow)

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

In your build.gradle file add the following dependency which includes the BidMachine adapter for use within GAM platform:

build.gradle
dependencies {
// Add BidMachine SDK dependency
implementation "io.bidmachine:ads:3.2.1"
// Add BidMachine SDK AdMob Adapter dependency
implementation "io.bidmachine:ads.adapters.admob:3.2.1.43"
// Add AdMob SDK dependency
implementation "com.google.android.gms:play-services-ads:24.1.0"
}

iOS

In your Podfile file add the following dependency which includes the BidMachine adapter for use within GAM platform:

Podfile
target 'Target' do
project 'Project.xcodeproj'
pod 'BidMachineAdMobAdapter', '~> 3.3.0.0'
end

Initialization

Android

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

MobileAds.initialize(context) {
// Optionally, enable test mode and logging
BidMachine.setTestMode(true)
BidMachine.setLoggingEnabled(true)
}

iOS

The BidMachineAdMobAdapter strarting 3.1.1.2 version offers robust support for waterfall integration. This integration type require to configure mediation groups in AdMob account by adding BidMachine Custom Events and Mappings.

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

However, if you need to configure additional BidMachineSdk settings, refer to the Logging and Test Mode below.

Logging and Test Mode

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

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

Additional Configuration

If you need to configure additional BidMachineSdk settings, refer to the documentation for Android SDK or iOS SDK.

GDPR Applies

BidMachine.setSubjectToGDPR(<GDPR APPLIES>)

TCF 2.0

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

TCF 1.0

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()

TCF 1.0

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>")

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()

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 Format

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