Login
Welcome
Login

inRead - AppLovin mediation


Prerequisites

Installation

Before installing the Teads AppLovin adapter, you will need to integrate AppLovin SDK into your application.

Gradle

project/build.gradle

allprojects {
  repositories {
    ...
    maven { url  "https://teads.jfrog.io/artifactory/SDKAndroid-maven-prod" }
  }
}

app/build.gradle

dependencies {
  ...
    implementation "com.applovin:applovin-sdk:11.1.2" // or higher

  // Teads inApp SDK
  implementation("tv.teads.sdk.android:sdk:5.x.x@aar") {
    transitive = true
  }

  // Teads AppLovin Adapter
  implementation 'tv.teads.sdk.android:applovinadapter:5.x.x'
}

Defining a Custom network

In order to display a Teads ad using AppLovin mediation,
you need to create a new Teads custom network and an new adunit using Teads custom network.

Teads Custom Network

Follow the custom network documentation (Step. 1) on the AppLovin dashboard using the below values.

Name Value
Android Class Name com.applovin.mediation.adapters.TeadsContextAdapter

Teads Ad Unit

Follow the custom network documentation (Step. 2) on the AppLovin dashboard using the below values.

Name Value
Placement ID (PID) See information below

Please retrieve your production PID from your local account manager.

See this page for test PIDs and creative formats.

⚠️ IMPORTANT NOTICE

Disable or higher the Refresh Interval by setting the dropdown to No Refresh or 5min refresh interval

Load an ad

You will need to initialize the AppLovinSdk, then pass your Ad Unit ID that you created before,
pass the teads settings using the teadsSettings key

AppLovinSdk.getInstance(this).mediationProvider = "max"
AppLovinSdk.getInstance(this).initializeSdk {} // you will need to wait this to finish before loading an ad

val adView = MaxAdView("YOUR_AD_UNIT_ID", MaxAdFormat.MREC,this)
val settingsEncoded = TeadsMediationSettings.Builder()
        .build()
        .toJsonEncoded()

adView.setLocalExtraParameter("teadsSettings", settingsEncoded)
adView.loadAd()

Ad Resizing

The code below must be implemented to enable the resizing of the mediated ad slot making possible the rendering of square and vertical creatives.

Initialize the TeadsHelper first.

TeadsHelper.initialize()

You can instantiate a new listener as below, the listener needs to be a class member field or strong referenced somewhere,
we keep internally a weak reference to it, so it goes garbage collected when you don't need it anymore:

listener = object : TeadsAdapterListener {
  override fun onRatioUpdated(adRatio: AdRatio) {
    val params: ViewGroup.LayoutParams = adView.layoutParams

    // Here the width is MATCH_PARENT
    params.height = adRatio.calculateHeight(adView.measuredWidth)
    adView.layoutParams = params
  }

  override fun adOpportunityTrackerView(trackerView: AdOpportunityTrackerView) {
  }
}

Use the helper to attach a listener, it will return you an UNIQUE key to reference the current listener attached.

val key = TeadsHelper.attachListener(listener)

Finally, add it to your current ad settings for the specific ad request

val settingsEncoded = TeadsMediationSettings.Builder()
        .enableDebug()
        .setMediationListenerKey(key)
        .build().toJsonEncoded()

adView.setLocalExtraParameter("teadsSettings", settingsEncoded)

Mediation settings

Find the full settings list here

Check list

  • ✅ Ensure Brand Safety is enabled
  • ✅ Ensure you comply with privacy legal requirements (GDPR/CCPA).
  • ✅ Comply with app-ads.txt
  • ✅ Enable ad view resizing
  • ✅ Test different test PIDs for multiple ad format and size testing
  • ✅ Enable Validation mode to ensure key features are working

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.