In-House Mediation

Integration

🚧

Requirements:

Min Android SDK version - 16 (4.1, Jelly Bean)

repositories {
    // Add BidMachine maven repository
    maven {
        url 'https://artifactory.bidmachine.io/bidmachine'
    }
}
 
dependencies {
    implementation "io.bidmachine:ads:1.9.9"
}

Supported version of Android Gradle Plugin

  • 3.3.3
  • 3.4.3
  • 3.5.4
  • 3.6.4
  • 4.0.1
  • or higher

Network security configuration

Android 9.0 (API 28) blocks cleartext (non-HTTPS) traffic by default, which can prevent ads from being served correctly.

❗️

Failure to comply with this configuration may result in lower display rate, fill rate, rendering errors, and as a result - lower revenue

  1. Add a Network Security Configuration file to your AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest>
    <application
        ...
        android:networkSecurityConfig="@xml/network_security_config"
        ... >
    </application>
</manifest>
  1. In your network_security_config.xml file, add base-config that sets cleartextTrafficPermitted to true:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config cleartextTrafficPermitted="true">
        <trust-anchors>
            <certificates src="system" />
        </trust-anchors>
    </base-config>
    <debug-overrides>
        <trust-anchors>
            <certificates src="user" />
        </trust-anchors>
    </debug-overrides>
</network-security-config>

Initialization

Initialize SDK, and set your SourceId.

📘

To get your SOURCE_ID, visit our website or contact the support.

BidMachine.initialize(Context, YOUR_SOURCE_ID);

// or with InitializationCallback
BidMachine.initialize(Context, YOUR_SOURCE_ID, InitializationCallback);

Enable logs if required:

BidMachine.setLoggingEnabled(Boolean);

Enable test mode:

BidMachine.setTestMode(Boolean);

Set your endpoint before initialization if required:

BidMachine.setEndpoint(String);

SDK can automatically track user device location to serve better ads. To make it work for Android 6.0, you should request android.permission.ACCESS_COARSE_LOCATION and android.permission.ACCESS_FINE_LOCATION:

ActivityCompat.requestPermissions(this, new String[]{
        Manifest.permission.ACCESS_COARSE_LOCATION,
        Manifest.permission.ACCESS_FINE_LOCATION
}, REQ_CODE);

Request parameters

Global Parameters

// Set default Targeting params
BidMachine.setTargetingParams(...);
 
// Set consent config
BidMachine.setConsentConfig(...);
 
// Set subject to GDPR
BidMachine.setSubjectToGDPR(...);
 
// Set COPPA
BidMachine.setCoppa(...);
 
// Set CCPA U.S. Privacy String
BidMachine.setUSPrivacyString(...);
 
// Sets publisher information
BidMachine.setPublisher(...);

User Restriction Parameters

Param

Type

Description

GDPR Consent String

String

GDPR consent string (if applicable), indicating the compliance with the IAB standard Consent String Format of the Transparency and ConsentFramework technical specifications.

Subject to GDPR

Boolean

Flag indicating if GDPR regulations apply The General Data Protection Regulation (GDPR) is a regulation of the European Union.

Coppa

Boolean

Flag indicating if COPPA regulations apply. The Children's Online Privacy Protection Act (COPPA) was established by the U.S. Federal Trade Commission.

US Privacy String

String

CCPA string if applicable, compliant with the IAB standard CCPA String Format

Code Example:

// Set consent config
BidMachine.setConsentConfig(Boolean, String);

// Set subject to GDPR
BidMachine.setSubjectToGDPR(Boolean);

// Set COPPA
BidMachine.setCoppa(Boolean);

// Set CCPA
BidMachine.setUSPrivacyString(String);

GDPR

The Publisher needs to send a boolean flag indicating if GDPR applies to the current user.
If so, the Publisher also needs to collect user consent prior to requesting any ads from the Exchange server. More information about collecting consent is here.

SDK has public methods to transfer 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 methods of data transfer at once, 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>);
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.

Targeting Parameters

Param

Type

Description

User Id

String

Vendor-specific ID for the user.

Gender

Enum

Gender, one of the following:
Female, Male, Omitted.

Year of Birth

Integer

Year of birth as a 4-digit integer (e.g. - 1990).

Keywords

String[]

List of keywords, interests, or intents (separated by comma if you use .xml).

Device Location

Location

Location of the device. It may not be the location sent to the server, as it is compared to the current device location at the time, when it was received.

Country

String

Country of the user's domicile (i.e. not necessarily their current location).

City

String

City of the user's domicile (i.e. not necessarily their current location).

Zip

String

Zip of the user's domicile (i.e. not necessarily their current location).

Store Url

String

App store URL for an installed app; for IQG 2.1 compliance.

Store Category

String

Sets App store category definitions (e.g. - "games").

Store Sub Category

String[]

Sets App Store Subcategory definitions. The array is always capped at 3 strings.

Framework Name

String

Sets app framework definitions.

Paid

Boolean

Determines, if the app version is free or paid version of the app.

External User Ids

List

Set external user ID list.

Blocked Advertiser IAB Category

String[]

Block list of content categories by IDs.

Blocked Advertiser Domain

String[]

Block list of advertisers by their domains (e.g., “example.com”).

Blocked Application

String[]

Block list of apps where ads are disallowed. These should be bundle or package names (e.g., “com.foo.mygame”) and should NOT be app store IDs (e.g., not iTunes store IDs).

Code Example:

TargetingParams targetingParams = new TargetingParams()
        .setUserId(String)
        .setGender(Gender)
        .setBirthdayYear(Integer)
        .setKeywords(String[])
        .setDeviceLocation(Location)
        .setCountry(String)
        .setCity(String)
        .setZip(String)
        .setStoreUrl(String)
        .setStoreCategory(String)
        .setStoreSubCategories(String[])
        .setFramework(String)
        .setPaid(Boolean)
        .setExternalUserIds(List<ExternalUserId>)
        .addBlockedAdvertiserIABCategory(String)
        .addBlockedAdvertiserDomain(String)
        .addBlockedApplication(String);
val targetingParams = TargetingParams()
        .setUserId(String)
        .setGender(Gender)
        .setBirthdayYear(Integer)
        .setKeywords(String[])
        .setDeviceLocation(Location)
        .setCountry(String)
        .setCity(String)
        .setZip(String)
        .setStoreUrl(String)
        .setStoreCategory(String)
        .setStoreSubCategories(String[])
        .setFramework(String)
        .setPaid(Boolean)
        .setExternalUserIds(List<ExternalUserId>)
        .addBlockedAdvertiserIABCategory(String)
        .addBlockedAdvertiserDomain(String)
        .addBlockedApplication(String)

TargetingParams can be passed with 2 ways:

  • Through global parameters:
BidMachine.setTargetingParams(targetingParams);
BidMachine.setTargetingParams(targetingParams)
  • Through ad request builder:
adRequestBuilder.setTargetingParams(targetingParams);
adRequestBuilder.setTargetingParams(targetingParams)

You can combine global parameters with regular. If you set Global TargetingParams using UserId, and then make a request using TargetingParams with Gender set, both requests will be merged and the resulting TargetingParams will include both UserId and Gender.

📘

Priority is given to the AdRequest parameters.

Price Floor Parameters

Parameter

Type

Description

Id

String

Unique floor identifier.

Price

double

Floor price

If you use the method with only Price provided PriceFloorParams.addPriceFloor(Double), the Id will be generated using UUID.randomUUID().

Code Example:

PriceFloorParams priceFloorParams = new PriceFloorParams()
        // Set Bid Price, in this case id will be generated
        .addPriceFloor(double)
        // Set Bid Id and Price
        .addPriceFloor(String, double);
val priceFloorParams = PriceFloorParams()
        // Set Bid Price, in this case id will be generated
        .addPriceFloor(Double)
        // Set Bid Id and Price
        .addPriceFloor(String, Double)

To set up price floor parameters for ad request use setPriceFloorParams method from AdRequest builder according to ads type.

adRequestBuilder.setPriceFloorParams(priceFloorParams);
adRequestBuilder.setPriceFloorParams(priceFloorParams)

Session Ad Parameters

Param

Type

Description

Session Duration

Integer

The total duration of time a user has spent so far in a specific app session expressed in seconds.

Impression Count

Integer

The count of impressions for a specific placement type in a given app session.

Click Rate

Float

The percentage of clicks/impressions per user per placement type over a given number of impressions.

Is User Clicked On Last Ad

Boolean

A boolean value indicating if the user clicked on the last impression in a given session per placement type.

Completion Rate

Float

The percentage of successful completions/impressions per user per placement type for a given number of impressions.
This only applies to Rewarded and Video placement types.

Code Example:

SessionAdParams sessionAdParams = new SessionAdParams()
        .setSessionDuration(Integer)
        .setImpressionCount(Integer)
        .setClickRate(Float)
        .setIsUserClickedOnLastAd(Boolean)
        .setCompletionRate(Float);
val sessionAdParams = SessionAdParams()
        .setSessionDuration(Integer)
        .setImpressionCount(Integer)
        .setClickRate(Float)
        .setIsUserClickedOnLastAd(Boolean)
        .setCompletionRate(Float)

To set up session ad parameters for ad request use setSessionAdParams method from AdRequest builder according to ads type.

adRequestBuilder.setSessionAdParams(sessionAdParams);
adRequestBuilder.setSessionAdParams(sessionAdParams)

Custom Parameters

📘

API added in version 1.9.1

Code Example:

CustomParams customParams = new CustomParams()
        .addParam(String, String)
        .addParams(Map<String, String>);
val customParams = CustomParams()
        .addParam(String, String)
        .addParams(Map<String, String>)

To set up custom parameters for ad request use setCustomParams method from AdRequest builder according to ads type.

adRequestBuilder.setCustomParams(customParams);
adRequestBuilder.setCustomParams(customParams)

Placement Id

📘

API added in version 1.7.4

To set up placement id for current impression use setPlacementId method from AdRequest builder according to ads type.

adRequestBuilder.setPlacementId(String);
adRequestBuilder.setPlacementId(String)

Bid Payload

📘

API added in version 1.7.2

To set up bid payload for ad request use setBidPayload method from AdRequest builder according to ads type.

adRequestBuilder.setBidPayload(String);
adRequestBuilder.setBidPayload(String)

Example

Auction result

Parameter

Type

Description

Sample

Id

String

Winner bid ID provided in the request.

"cc5bd14b-aaef-4037-b4f8-879913366e3c"

Demand Source

String

Winner advertising source name.

"BidMachine Test"

Price

double

Winner price expressed as CPM.

0.023

Deal

String

Id of Price Floor.

"d6f61bf9-11a8-4172-a77d-4b1ff85a727f"

Creative Id

String

Winner creative id.

"123.13579"

CID

String

Winner Campaign ID or other similar grouping of brand-related ads.

"123.13587"

Ad Domain

String[]

Winner advertiser domain (top two levels only e.g., "ford.com").

["sample1.com", "sample2.com"]

Network Key

String

Winner network key. This network will be loaded.

"mraid"

Network Params

Map<String, String>

Client parameters of winner networks.

Creative Format

Enum

CreativeFormat, one of the following:
Banner, Video, Native.

CreativeFormat.Video

Custom Params

Map<String, String>

Map that contains additional information about the response.

You can get AuctionResult in two ways:

  • Through AdRequestListener. Use AuctionResult from onRequestSuccess callback
adRequestBuilder.setListener(new <AdRequestObject>.AdRequestListener() {
    @Override
    public void onRequestSuccess(@NonNull <AdRequestObject> adRequest,
                                 @NonNull AuctionResult auctionResult) {
        // Use AuctionResult from onRequestSuccess callback
    }
});
adRequestBuilder.setListener(object : <AdRequestObject>.AdRequestListener {
    override fun onRequestSuccess(adRequest: <AdRequestObject>,
                                  auctionResult: AuctionResult) {
        // Use AuctionResult from onRequestSuccess callback
    }
});
  • Through getter. Each AdRequest has an option to retrieve auction result information after it has been loaded.
adRequest.getAuctionResult();
adRequest.auctionResult;

Win/Loss notifications

📘

API added in version 1.7.7

Call notifyMediationWin/notifyMediationLoss on the AdRequest instance when BidMachine wins/loses the mediation among networks.

  • Win notification:
adRequest.notifyMediationWin();
adRequest.notifyMediationWin()
  • Loss notification:
adRequest.notifyMediationLoss(<WINNER_NETWORK_NAME>, <WINNER_NETWORK_PRICE>);
// or
adRequest.notifyMediationLoss();
adRequest.notifyMediationLoss(<WINNER_NETWORK_NAME>, <WINNER_NETWORK_PRICE>)
// or
adRequest.notifyMediationLoss()

Bid Token

📘

API added in version 1.9.0

With S2S integration, you will need a BidToken that you need to transfer in the request. To get a BidToken, you can use one of 2 methods:

// Must be run on background thread
String bidToken = BidMachine.getBidToken(context);
val bidToken = BidMachine.getBidToken(context)

or

BidMachine.getBidToken(context, new BidTokenCallback() {
    @Override
    public void onCollected(@NonNull String bidToken) {
        // The BidToken will be returned on a background thread
    }
});
BidMachine.getBidToken(applicationContext) { bidToken ->
    // The BidToken will be returned on a background thread
}

Device Advertising ID

In mobile apps, there are no cookies. Instead, Ad Manager uses user-resettable identifiers provided by the mobile device's operating system. Typical advertising IDs are AdID (Android) and IDFA (Apple). Mobile advertising IDs allow developers and marketers to track activity for advertising purposes. They're also used to enhance serving and targeting capabilities.

Play Services version older or equal to 15.0.0 (Recommended)

Add Play Services Ads Identifier dependency:
implementation 'com.google.android.gms:play-services-ads-identifier:15.0.0'

Play services version 8.3.0 - 12.0.1

Add Play Services Basement dependency:
implementation "com.google.android.gms:play-services-basement:15.0.0"

Play services version lower or equal 8.1.0

Add Play Service Ads dependency:
implementation "com.google.android.gms:play-services-ads:REQURED_VERSION"

📘

Read More

How to include Google Play Service Ads to your app link

If you have warnings in build.gradle file on different versions of support libraries, you can exclude these libraries from the dependency:

implementation("com.google.android.gms:<i>REQUIRED_SERVICE</i>:<i>REQUIRED_VERSION</i>") {
    exclude module: 'support-v4'
    exclude module: 'support-v7'
}

3rd party SDK integration (Header-Bidding)

You can find all integration code examples written in Java and Kotlin here

🚧

All 3rd party networks should be configured and registered before SDK initialization


AdColony

📘

Supported ad types

  • Interstitial
  • Rewarded

Add this to Module-level build.gradle before dependencies:

repositories {
    google()
    mavenCentral() 
}

Add the following dependency to you build.gradle:

dependencies {
    implementation "io.bidmachine:ads.networks.adcolony:1.9.9.11"
}

Configure network:

BidMachine.registerNetworks(
        new AdColonyConfig("YOUR_APP_ID")
                .withMediationConfig(AdsFormat.InterstitialVideo, "YOUR_ZONE_ID")
                .withMediationConfig(AdsFormat.RewardedVideo, "YOUR_ZONE_ID"));
BidMachine.registerNetworks(
    AdColonyConfig("YOUR_APP_ID")
        .withMediationConfig(AdsFormat.InterstitialVideo, "YOUR_ZONE_ID")
        .withMediationConfig(AdsFormat.RewardedVideo, "YOUR_ZONE_ID"))

📘

By default, we provide google as storeId parameter to AdColony network


Amazon

📘

Supported ad types

  • Banner
  • Interstitial

🚧

Minimum supported Android version is API Level 19

Add this to Module-level build.gradle before dependencies:

repositories {
    google()
    mavenCentral()
}

Add the following configuration to your app level build.gradle:

android {
    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }
}

Add next dependency to you build.gradle:

dependencies {
    implementation "io.bidmachine:ads.networks.amazon:1.9.9.7"
}

Configure network:

BidMachine.registerNetworks(
        new AmazonConfig("YOUR_APP_KEY")
               .withMediationConfig(AdsFormat.Banner_320x50, "YOUR_SLOT_UUID")
               .withMediationConfig(AdsFormat.Banner_300x250, "YOUR_SLOT_UUID")
               .withMediationConfig(AdsFormat.Banner_728x90, "YOUR_SLOT_UUID")
               .withMediationConfig(AdsFormat.InterstitialStatic, "YOUR_SLOT_UUID")
               .withMediationConfig(AdsFormat.InterstitialVideo, "YOUR_SLOT_UUID"));
BidMachine.registerNetworks(
    AmazonConfig("YOUR_APP_KEY")
        .withMediationConfig(AdsFormat.Banner_320x50, "YOUR_SLOT_UUID")
        .withMediationConfig(AdsFormat.Banner_300x250, "YOUR_SLOT_UUID")
        .withMediationConfig(AdsFormat.Banner_728x90, "YOUR_SLOT_UUID")
        .withMediationConfig(AdsFormat.InterstitialStatic, "YOUR_SLOT_UUID")
        .withMediationConfig(AdsFormat.InterstitialVideo, "YOUR_SLOT_UUID"))

🚧

IAB TCFv2

Amazon support only IAB TCFv2.
IAB TCFv1 is not supported, see

Criteo

📘

Supported ad types

  • Banner
  • Interstitial

Add this to Module-level build.gradle before dependencies:

repositories {
    google()
    mavenCentral()
}

Add the following dependency to you build.gradle:

dependencies {
    implementation "io.bidmachine:ads.networks.criteo:1.9.9.10"
}

Configure network:

BidMachine.registerNetworks(
        new CriteoConfig("YOUR_PUBLISHER_ID")
                .withMediationConfig(AdsFormat.Banner_320x50, "YOUR_AD_UNIT_ID")
                .withMediationConfig(AdsFormat.Banner_300x250, "YOUR_AD_UNIT_ID")
                .withMediationConfig(AdsFormat.Banner_728x90, "YOUR_AD_UNIT_ID")
                .withMediationConfig(AdsFormat.InterstitialStatic, "YOUR_AD_UNIT_ID")
                .withMediationConfig(AdsFormat.InterstitialStatic, "YOUR_AD_UNIT_ID", Orientation.Portrait)
                .withMediationConfig(AdsFormat.InterstitialStatic, "YOUR_AD_UNIT_ID", Orientation.Landscape));
BidMachine.registerNetworks(
    CriteoConfig("YOUR_PUBLISHER_ID")
        .withMediationConfig(AdsFormat.Banner_320x50, "YOUR_AD_UNIT_ID")
        .withMediationConfig(AdsFormat.Banner_300x250, "YOUR_AD_UNIT_ID")
        .withMediationConfig(AdsFormat.Banner_728x90, "YOUR_AD_UNIT_ID")
        .withMediationConfig(AdsFormat.InterstitialStatic, "YOUR_AD_UNIT_ID")
        .withMediationConfig(AdsFormat.InterstitialStatic, "YOUR_AD_UNIT_ID", Orientation.Portrait)
        .withMediationConfig(AdsFormat.InterstitialStatic, "YOUR_AD_UNIT_ID", Orientation.Landscape))

If orientation has been specified for an AdUnit, then that AdUnit will only be used for that particular orientation.

If there is no AdUnit for the current orientation, an AdUnit without specific orientation will be taken.

For example:

BidMachine.registerNetworks(
        new CriteoConfig("YOUR_PUBLISHER_ID")
                .withMediationConfig(AdsFormat.InterstitialStatic, "AD_UNIT_ID_1")
                .withMediationConfig(AdsFormat.InterstitialStatic, "AD_UNIT_ID_2", Orientation.Landscape));
BidMachine.registerNetworks(
    CriteoConfig("YOUR_PUBLISHER_ID")
        .withMediationConfig(AdsFormat.InterstitialStatic, "AD_UNIT_ID_1")
        .withMediationConfig(AdsFormat.InterstitialStatic, "AD_UNIT_ID_2", Orientation.Landscape))

With this configuration:

AD_UNIT_ID_2 will be used, when in landscape orientation
AD_UNIT_ID_1 will be used, when in portrait orientation

Such AdUnits should be indicated at the end, as shown in the examples above.


MetaAudience

📘

Supported ad types

  • Banner
  • Interstitial
  • Rewarded
  • Native (Experimental)

Add this to Module-level build.gradle before dependencies:

repositories {
    mavenCentral() 
}

Add the following dependency to you build.gradle:

dependencies {
    implementation "io.bidmachine:ads.networks.meta_audience:1.9.9.12"
}

Update your network_security_config.xml file, add domain-config that sets cleartextTrafficPermitted to true:

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">127.0.0.1</domain>
    </domain-config>
</network-security-config>

Configure network:

BidMachine.registerNetworks(
        new MetaAudienceConfig("YOUR_APP_ID")
                .withMediationConfig(AdsFormat.Banner, "YOUR_PLACEMENT_ID")
                .withMediationConfig(AdsFormat.Banner_300x250, "YOUR_PLACEMENT_ID")
                .withMediationConfig(AdsFormat.InterstitialStatic, "YOUR_PLACEMENT_ID")
                .withMediationConfig(AdsFormat.RewardedVideo, "YOUR_PLACEMENT_ID")
                .withMediationConfig(AdsFormat.Native, "YOUR_PLACEMENT_ID"));
BidMachine.registerNetworks(
    MetaAudienceConfig("YOUR_APP_ID")
        .withMediationConfig(AdsFormat.Banner, "YOUR_PLACEMENT_ID")
        .withMediationConfig(AdsFormat.Banner_300x250, "YOUR_PLACEMENT_ID")
        .withMediationConfig(AdsFormat.InterstitialStatic, "YOUR_PLACEMENT_ID")
        .withMediationConfig(AdsFormat.RewardedVideo, "YOUR_PLACEMENT_ID")
        .withMediationConfig(AdsFormat.Native, "YOUR_PLACEMENT_ID"))

🚧

Native (Experimental)

MetaAudience native have two type:

  • Native Banner Ads
  • Native Ads

Native ads may not work correctly if MetaAudience placements were submitted that did not match the selected MediaAssetType. For example, if you want use MediaAssetType.Icon, you need submit placements of Native Banner Ads type, otherwise you need submit placements of Native Ads type.


myTarget

📘

Supported ad types

  • Banner
  • Interstitial
  • Rewarded

Add the following dependency to you build.gradle:

dependencies {
    implementation "io.bidmachine:ads.networks.my_target:1.9.9.9"
}

Configure network:

BidMachine.registerNetworks(
        new MyTargetConfig()
               .withMediationConfig(AdsFormat.Banner, "YOUR_SLOT_ID")
               .withMediationConfig(AdsFormat.Banner_320x50, "YOUR_SLOT_ID")
               .withMediationConfig(AdsFormat.Banner_300x250, "YOUR_SLOT_ID")
               .withMediationConfig(AdsFormat.Banner_728x90, "YOUR_SLOT_ID")
               .withMediationConfig(AdsFormat.InterstitialStatic, "YOUR_SLOT_ID")
               .withMediationConfig(AdsFormat.RewardedVideo, "YOUR_SLOT_ID"));
BidMachine.registerNetworks(
    MyTargetConfig()
        .withMediationConfig(AdsFormat.Banner, "YOUR_SLOT_ID")
        .withMediationConfig(AdsFormat.Banner_320x50, "YOUR_SLOT_ID")
        .withMediationConfig(AdsFormat.Banner_300x250, "YOUR_SLOT_ID")
        .withMediationConfig(AdsFormat.Banner_728x90, "YOUR_SLOT_ID")
        .withMediationConfig(AdsFormat.InterstitialStatic, "YOUR_SLOT_ID")
        .withMediationConfig(AdsFormat.RewardedVideo, "YOUR_SLOT_ID"))

Notsy

📘

Supported ad types

  • Interstitial
  • Rewarded

Add this to Project-level build.gradle before dependencies:

buildscript {
    repositories {
        google()
        mavenCentral()
    }
}

Add this to Module-level build.gradle before dependencies:

repositories {
    google()
    mavenCentral()
}

Add the following dependency to you build.gradle:

dependencies {
    implementation "com.google.android.gms:play-services-ads:20.6.0"
    implementation "io.bidmachine:ads.networks.notsy:1.9.9.1"
}

Add APPLICATION_ID to AndroidManifest.xml:

<manifest>
    <application>
        <!-- Sample Ad Manager app ID: ca-app-pub-3940256099942544~3347511713 -->
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/>
    </application>
</manifest>

Pangle

📘

Supported ad types

  • Banner
  • Interstitial
  • Rewarded

Add this to Module-level build.gradle before dependencies:

repositories {
    maven {
        url 'https://artifact.bytedance.com/repository/pangle'
    }
}

Add the following dependency to you build.gradle:

dependencies {
    implementation "io.bidmachine:ads.networks.pangle:1.9.9.4"
}

Configure network:

BidMachine.registerNetworks(
        new PangleConfig("YOUR_APP_ID")
                .withMediationConfig(AdsFormat.Banner, "YOUR_SLOT_ID")
                .withMediationConfig(AdsFormat.Interstitial, "YOUR_SLOT_ID")
                .withMediationConfig(AdsFormat.Rewarded, "YOUR_SLOT_ID"));
BidMachine.registerNetworks(
    PangleConfig("YOUR_APP_ID")
        .withMediationConfig(AdsFormat.Banner, "YOUR_SLOT_ID")
        .withMediationConfig(AdsFormat.Interstitial, "YOUR_SLOT_ID")
        .withMediationConfig(AdsFormat.Rewarded, "YOUR_SLOT_ID"))

Tapjoy

📘

Supported ad types

  • Interstitial
  • Rewarded

Add this to Module-level build.gradle before dependencies:

repositories {
    google()
    maven {
        name "Tapjoy's maven repo"
        url "https://sdk.tapjoy.com/"
    }
}

Add the following dependency to you build.gradle:

dependencies {
    implementation "io.bidmachine:ads.networks.tapjoy:1.9.9.9"
}

Configure network:

BidMachine.registerNetworks(
        new TapjoyConfig("YOUR_SDK_KEY")
               .withMediationConfig(AdsFormat.InterstitialVideo, "YOUR_PLACEMENT_NAME")
               .withMediationConfig(AdsFormat.RewardedVideo, "YOUR_PLACEMENT_NAME"));
BidMachine.registerNetworks(
    TapjoyConfig("YOUR_SDK_KEY")
        .withMediationConfig(AdsFormat.InterstitialVideo, "YOUR_PLACEMENT_NAME")
        .withMediationConfig(AdsFormat.RewardedVideo, "YOUR_PLACEMENT_NAME"))

Vungle

📘

Supported ad types

  • Interstitial
  • Rewarded

Add this to Module-level build.gradle before dependencies:

repositories {
    google()
    mavenCentral()
}

Add the following dependency to you build.gradle:

dependencies {
    implementation "io.bidmachine:ads.networks.vungle:1.9.9.2"
}

Configure network:

BidMachine.registerNetworks(
        new VungleConfig("YOUR_APP_ID", "YOUR_PUBLISHER_ID")
                .withMediationConfig(AdsFormat.InterstitialVideo, "YOUR_PLACEMENT_ID")
                .withMediationConfig(AdsFormat.RewardedVideo, "YOUR_PLACEMENT_ID"));
BidMachine.registerNetworks(
    VungleConfig("YOUR_APP_ID", "YOUR_PUBLISHER_ID")
        .withMediationConfig(AdsFormat.InterstitialVideo, "YOUR_PLACEMENT_ID")
        .withMediationConfig(AdsFormat.RewardedVideo, "YOUR_PLACEMENT_ID"));