Documentation

Google Ad Manager Bidding

👍

Full Technical Documentation

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

Integration

🚧

Requirements:

Min Android SDK version - 21 (5.0, Lollipop)

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 AdManager Adapter dependency
    implementation "io.bidmachine:ads.adapters.admanager:2.7.0.16"
    // Add AdManager SDK dependency
    implementation "com.google.android.gms:play-services-ads:23.2.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.

SDK has public methods to transfer them GDPR data. Also, SDK automatically retrieves GDPR from SharedPreference. If you would like to pass the GDPR data 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 the GDPR data from the SharedPreference.

GDPR Applies

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

GDPR Consent String

BidMachine.setConsentConfig(..., "<GDPR CONSENT STRING>");
PreferenceManager.getDefaultSharedPreferences(this)
        .edit()
        .putString("IABTCF_TCString", "<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>");

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 will read this from the SharedPreference.

SDK Configuration Sample

Logging and Test Mode

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

BidMachine.setLoggingEnabled(true);
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.