Skip to content

TopOn Mediation Integration

Supported Ad Formats

TopOn Ad FormatMinimum required version of Opera adapter
Native2.0.0.0
Banner2.0.0.0
Interstitial2.0.0.0
Rewarded2.0.0.0
Splash2.5.0.0

Configure Custom Ad Network in TopOn Console

Refer to Custom Network on TopOn Mediation Network Guide for detailed information.

Add Custom Ad Network

  1. Sign in to the TopOn Console
  2. Navigate to MediationNetworkCustom Network
  3. Click Add Custom Network

Add custom network

Configure Adapter Class Names for Different Ad Formats

TopOn requires separate adapter classes for each ad format:

Ad FormatAdapter Class Name (Android)
Nativecom.opera.ads.mediation.topon.OperaNativeAdapter
Bannercom.opera.ads.mediation.topon.OperaBannerAdapter
Interstitialcom.opera.ads.mediation.topon.OperaInterstitialAdapter
Rewardedcom.opera.ads.mediation.topon.OperaRewardAdapter
Splashcom.opera.ads.mediation.topon.OperaSplashAdapter

Set custom network

After the Ad Network is added, click Ad Source Settings. Select banner format ad units, click Add Ad Source. Please set the correct size for corresponding Opera Banner AdSize when you add an "Ad Source" for the ad unit of Banner on TopOn console. The "size" of AdSize.BANNER should be "320x50" in DP, and for AdSize.BANNER_MREC it should be "300x250" in DP.

Also, please also make sure Bottom Ads is enabled, for Opera Ads network to be the backfill ad network for unbidded requests. Banner ad size

Add Dependencies

Add Opera Ads SDK maven repository:

kotlin
repositories {
    maven {
        url = uri("https://artifact.op-mobile.opera.com/releases")
    }
}

// For the versions of TopOn SDK before **6.5.12**, add the following dependencies to your app's `build.gradle` or `build.gradle.kts` file:
dependencies {
    // Opera Ads custom adapter for TopOn < 6.5.12
    implementation("com.opera:opera-ads-topon-anythink-adapter:+")

    // TopOn SDK (Anythink package name - for SDK < 6.5.12)
    val tpnSdk = "6.5.11"
    implementation("com.anythink.sdk:core-tpn:$tpnSdk")
    implementation("com.anythink.sdk:banner-tpn:$tpnSdk")
    implementation("com.anythink.sdk:interstitial-tpn:$tpnSdk")
    implementation("com.anythink.sdk:rewardedvideo-tpn:$tpnSdk")
    implementation("com.anythink.sdk:nativead-tpn:$tpnSdk")
    implementation("com.anythink.sdk:splash-tpn:$tpnSdk")
}

// Since Opera Ads SDK v2.4.0, we support TopOn SDK \>= 6.5.12, add the dependencies as follows:
dependencies {
    // Opera Ads TopOn Adapter for package name "com.secmtp.sdk"
    implementation("com.opera:opera-ads-topon-secmtp-adapter:+")

    // TopOn SDK (Anythink package name - for SDK in [6.5.12, 6.5.40])
    val tpnSdk = "6.5.12"
    implementation("com.anythink.sdk:core-tpn:$tpnSdk")
    implementation("com.anythink.sdk:banner-tpn:$tpnSdk")
    implementation("com.anythink.sdk:interstitial-tpn:$tpnSdk")
    implementation("com.anythink.sdk:rewardedvideo-tpn:$tpnSdk")
    implementation("com.anythink.sdk:nativead-tpn:$tpnSdk")
    implementation("com.anythink.sdk:splash-tpn:$tpnSdk")
}

// For the versions of TopOn SDK after **6.5.40**, add the dependencies as follows:
dependencies {
    // Opera Ads TopOn Adapter for package name "com.secmtp.sdk"
    implementation("com.opera:opera-ads-topon-secmtp-adapter:2.10.0.0")

    // TopOn SDK (Anythink package name - for SDK > 6.5.40)
    implementation("com.anythink.sdk:core-tpn:6.5.41")
}

Additional Code Optional

Native Ad

We supports setting the position of Ad Choice with TopOn extra property ATAdConst.KEY.AD_CHOICES_PLACEMENT.

java
Map<String, Object> localExtra = new HashMap<>();
// Specify the position of the 'i' icon
localExtra.put(ATAdConst.KEY.AD_CHOICES_PLACEMENT, ATAdConst.AD_CHOICES_PLACEMENT_TOP_LEFT);
mATNative.setLocalExtra(localExtra);

Privacy Compliance

GDPR

Please refer to GDPR, Opera Ads SDK reads application's consent string automatically.

COPPA

Please refer to COPPA. You can use the API PrivacyManager.setCoppa(...) to set coppa status.

CCPA (U.S. states privacy)

Please refer to U.S. states privacy setup. You cna use the API PrivacyManager.setUSPrivacy(...) to set the compliance status of CCPA.