Skip to content

Banner Fallback

ADvantage now has the option to rely on a secondary SDK to retrieve a new AD in case the ad server does not deliver an appropriate ad to the client.

Info

This is a new feature, we are only supporting TeadsSDK for the moment.

Importing Teads Adaptor AAR

  1. Follow the import aar instructions page. Here

  2. After importing the aar into your project

Warning

To use the adaptor is necessary to have both ADvantageSDK and TeadsSDK imported into the project.

After you create a banner:

  • Create a new instance of the adaptor you want to use, eg.: ADvantageTeadsAdaptor, and pass to the banner the necessary information to use the fallback solution.

Important

Please ask our sales team for the Teads PID and contract first before you start using it. The provided PID in the example is for testing only.

Java
TeadsAdaptor adaptor;
Advantage banner;

protected void onCreate(Bundle savedInstanceState) {
    createAdaptorBanner();
    createAdvantageBanner();
    LinearLayout bannerContainer = (LinearLayout) outer.findViewById(R.id.banner_container);
    bannerContainer.addView(banner);

    banner.showAd();
}

public void createAdaptorBanner() {
    adaptor = new TeadsAdaptor(this, 84242); // this is a test pid from Teads
    adaptor.pageUrl = "https://example.com/article1";
    adaptor.subjectToGDPR = ""; // https://support.teads.tv/support/solutions/articles/36000166727-3-privacy-consent-management-gdpr-ccpa-
    adaptor.consentGdpr = ""; // https://support.teads.tv/support/solutions/articles/36000166727-3-privacy-consent-management-gdpr-ccpa-
    adaptor.isDebugEnabled = false;
}

public void createAdvantageBanner() {
    banner = new Advantage(this, "<LICENSE_KEY>", "<SITE_ID>", "<POSITION>");
    banner.setSSLEnabled(true);

    //Optionally add your custom loading animation
    banner.setLoadingAnimationImageViewResourceId(R.drawable.loading_animation);

    banner.setFallbackAdaptor(adaptor);
}
  • Placement ID (PID for short), is a value you need to get with Teads for your fallback banners.

  • The publisher http page url that matches the content where Teads Ad will be loaded into, more information use the link - Teads brand safety.

  • Consent management platform (CMP), is to tell Teads if your CMP is iAB compliant, for more information use the link -Teads CMP.

  • To validate your Teads banners you set the adaptor debug mode on, which will trigger the first step for validating it, check the rest of the steps on Teads site Validate Integration.

Java
adaptor.isDebugEnabled = true;