Skip to main content

4.2 Admob Adapter

Note: Due to internal logic limitations of the Google Ads SDK, offline scenario traffic cannot be forwarded to the Hisavana SSP SDK via the adapter. If you wish to use Hisavana SSP's offline capabilities, it is recommended that you integrate the Hisavana SSP SDK directly.

4.2.1 Version Release History​

VersionRelease DateUpdatesminSdkVersion
3.6.6.1.12026-07-28Depends on Hisavana SSP SDK version 3.6.6.1; google play-services-ads version 25.4.023

4.2.2 AdMob Console Configuration Process​

  1. On the home page, go to Mediation, then create or select a mediation group for the corresponding ad format.

  2. Under Ad Sources, select Waterfall and add a Custom Event.

  3. Add a new ad unit mapping and enter:

    • Class Name: com.hisavana.admob.adapter.HisavanaAdapter
    • Parameter: A JSON string. For appId, enter the App ID obtained from the Hisavana SSP console. For codeSeatId, enter the Code Seat ID obtained from the Hisavana SSP console. Example: {"appId":"testsid880","codeSeatId":"splash_1"}
  4. Configure a CPM for this mapping in the AdMob mediation group. This CPM is the sorting price used by AdMob Waterfall, not a price returned by Hisavana SSP in real time.

  5. Save the changes and confirm that the mediation group is enabled, and that the ad unit, region, ad format, and code seat ad format are consistent.

4.2.3 Importing the Adapter SDK into the Project​

First, add the maven remote repository URL to the project-level build.gradle file, as shown below:

buildscript { 
repositories {
maven { url "https://mvn.shalltry.com/repository/maven-public/" }
maven { url "https://mvn.shalltry.com/repository/ad-releases/" }
}
}

allprojects {
repositories {
maven { url "https://mvn.shalltry.com/repository/maven-public/" }
maven { url "https://mvn.shalltry.com/repository/ad-releases/" }
}
}

Then, introduce the admob adapter package in the Module's build.gradle:

implementation "com.cloud.hisavana.sdk.ssp.adapter:admob:3.6.6.1.1"
implementation "com.google.android.gms:play-services-ads:25.4.0"

4.2.4 SDK Initialization Configuration​

public class MyApplication extends Application {

@Override
public void onCreate() {
super.onCreate();

// Enable Hisavana SSP log output
HisavanaAdapterUtil.setAdapterLoggingEnabled(true);
// Enable Hisavana SSP Adapter test mode. Be sure to set the parameter to false before release
HisavanaAdapterUtil.setTestRequestEnable(true);

// Google Ads Initialization
MobileAds.initialize(this.getApplicationContext(), initializationStatus -> {
Log.d("MobileAds", "Init status: " + initializationStatus.toString());
});
}
}

4.2.5 Integration Testing​

Adapter log filter tag: HisavanaAdapter

Run the following command to enable DEBUG logging:

adb shell setprop log.tag.HisavanaAdapter DEBUG

4.2.6 Using Google Ads API to Request Ads​

(Omitted)