Integrazione di DT Exchange con la mediazione

This guide shows you how to use the Google Mobile Ads SDK to load and display ads from DT Exchange using mediation, covering waterfall integrations. It covers how to add DT Exchange to an ad unit's mediation configuration and how to integrate the DT Exchange SDK and adapter into an Android app.

Supported integrations and ad formats

The AdMob mediation adapter for DT Exchange has the following capabilities:

Integration
Bidding
Waterfall
Formats
Banner
Interstitial
Rewarded
Native

Requirements

  • Android API level 21 or higher

Step 1: Set up configurations in DT Exchange UI

Aggiungi nuova app e nuovo posizionamento dell'annuncio

Registrati o accedi a DT Exchange Console.

Fai clic sul pulsante Aggiungi app per aggiungere la tua app.

Gestisci applicazioni

Seleziona la tua Piattaforma, compila la parte restante del modulo e fai clic su Aggiungi posizionamenti.

Inserisci un nome per il nuovo posizionamento nel campo Assegna un nome al posizionamento e seleziona il Tipo di posizionamento desiderato dall'elenco a discesa. Infine, fai clic su Salva posizionamento.

Configurazione

ID app e ID posizionamento

Passa il mouse sopra la barra di navigazione a sinistra. Fai clic su App nel menu a sinistra.

Menu

Nella pagina Gestione app, prendi nota dell'ID app accanto all'app.

ID app

Seleziona l'app, vai alla scheda Posizionamenti e fai clic sull'icona di copia accanto a Nome posizionamento. Prendi nota dell'ID posizionamento.

ID posizionamento

ID publisher, chiave utente e secret del consumatore

Fai clic sul tuo nome utente nel menu a sinistra e seleziona Profilo utente.

Menu Profilo utente

Prendi nota dell'ID publisher, della chiave del consumatore e del segreto del consumatore, perché sono necessari nel passaggio successivo.

Profilo utente

Step 2: Set up DT Exchange demand in AdMob UI

Configurare le impostazioni di mediazione per l'unità pubblicitaria

Devi aggiungere DT Exchange alla configurazione della mediazione per la tua unità pubblicitaria.

Innanzitutto, accedi all'account AdMob. Quindi, vai alla scheda Mediazione. Se vuoi modificare un gruppo di mediazione esistente, fai clic sul nome del gruppo per modificarlo e vai alla sezione Aggiungi DT Exchange come origine annuncio.

Per creare un nuovo gruppo di mediazione, seleziona Crea gruppo di mediazione.

Inserisci il formato dell'annuncio e la piattaforma, poi fai clic su Continua.

Assegna un nome al gruppo di mediazione e seleziona le località da scegliere come target. Imposta lo stato del gruppo di mediazione su Attivato e fai clic su Aggiungi unità pubblicitarie.

Associa questo gruppo di mediazione a una o più unità pubblicitarieAdMob esistenti. Poi, fai clic su Fine.

A questo punto, dovresti vedere la scheda delle unità pubblicitarie compilata con quelle selezionate:

Aggiungi DT Exchange come origine annuncio

Nella scheda Con struttura a cascata della sezione Origini annuncio, seleziona Aggiungi origine annuncio. Seleziona DT Exchange.

Seleziona DT Exchange e attiva l'opzione Ottimizza. Inserisci quanto Publisher ID, Consumer Secret and Consumer Key ottenuto nella sezione precedente per configurare l'ottimizzazione dell'origine annuncio per DT Exchange. Inserisci un valore eCPM perDT Exchange e fai clic su Continua.

Se hai già una mappatura per DT Exchange, puoi selezionarla. In caso contrario, fai clic su Aggiungi mappatura.

Quindi, inserisci l' Application ID and Placement ID ottenuto nella sezione precedente. Poi, fai clic su Fine.

Add Fyber to GDPR and US state regulations ad partners list

Segui i passaggi descritti in Impostazioni GDPR e Impostazioni relative alle normative statali degli Stati Uniti per aggiungere Fyber all'elenco di partner pubblicitari per le normative GDPR e statali degli Stati Uniti nell' AdMob UI.

Step 3: Import the DT Exchange SDK and adapter

In your app-level build.gradle.kts file, add the following implementation dependencies and configurations. Use the latest versions of the DT Exchange SDK and adapter:

dependencies {
    implementation("com.google.android.gms:play-services-ads:23.0.0")
    implementation("com.google.ads.mediation:fyber:8.2.7.0")
}

Manual integration

  • Download the latest version of the DT Exchange SDK for Android and add the following files to your project:
    • ia-mraid-kit-release-x.y.z.aar
    • ia-sdk-core-release-x.y.z.aar
    • ia-video-kit-release-x.y.z.aar
  • Navigate to the DT Exchange adapter artifacts on Google's Maven Repository. Select the latest version, download the DT Exchange adapter's .aar file, and add it to your project.

Step 4: Implement privacy settings on DT Exchange SDK

Under the Google EU User Consent Policy, you must ensure that certain disclosures are given to, and consents obtained from, users in the European Economic Area (EEA) regarding the use of device identifiers and personal data. This policy reflects the requirements of the EU ePrivacy Directive and the General Data Protection Regulation (GDPR). When seeking consent, you must identify each ad network in your mediation chain that may collect, receive, or use personal data and provide information about each network's use. Google currently is unable to pass the user's consent choice to such networks automatically.

DT Exchange contains an API that lets you forward user consent to their SDK. The following sample code shows how to pass consent information to the DT Exchange SDK manually. Should you choose to pass consent information to the DT Exchange SDK manually, it is recommended that this code is called prior to requesting ads through the Google Mobile Ads SDK.

Java

import com.fyber.inneractive.sdk.external.InneractiveAdManager;
// ...

InneractiveAdManager.setGdprConsent(true);
InneractiveAdManager.setGdprConsentString("myGdprConsentString");

Kotlin

import com.fyber.inneractive.sdk.external.InneractiveAdManager
// ...

InneractiveAdManager.setGdprConsent(true)
InneractiveAdManager.setGdprConsentString("myGdprConsentString")

Visit DT Exchange's GDPR Resource Page and their GDPR implementation guide for more details and the values that may be provided in the method.

US states privacy laws

U.S. states privacy laws require giving users the right to opt out of the "sale" of their "personal information" (as the law defines those terms), with the opt-out offered via a prominent "Do Not Sell My Personal Information" link on the "selling" party's homepage. The U.S. states privacy laws compliance guide offers the ability to enable restricted data processing for Google ad serving, but Google is unable to apply this setting to each ad network in your mediation chain. Therefore, you must identify each ad network in your mediation chain that may participate in the sale of personal information and follow guidance from each of those networks to ensure compliance.

DT Exchange contains an API that lets you forward user consent to their SDK. The following sample code shows how to pass consent information to the DT Exchange SDK manually. Should you choose to pass consent information to the DT Exchange SDK manually, it is recommended that this code is called prior to requesting ads through the Google Mobile Ads SDK.

Java

import com.fyber.inneractive.sdk.external.InneractiveAdManager;
// ...

InneractiveAdManager.setUSPrivacyString("myUSPrivacyString");

Kotlin

import com.fyber.inneractive.sdk.external.InneractiveAdManager
// ...

InneractiveAdManager.setUSPrivacyString("myUSPrivacyString")

Visit DT Exchange's CCPA Resource Page and their CCPA implementation guide for more details and the values that may be provided in the method.

Step 5: Add required code

No additional code is required for DT Exchange integration.

Step 6: Test your implementation

Attiva annunci di prova

Assicurati di registrare il dispositivo di test per AdMob

Verifica annunci di prova

Per verificare di ricevere annunci di prova daDT Exchange, attiva il test di una singola origine annuncio nello strumento di controllo degli annunci utilizzando le DT Exchange (Waterfall) origini annuncio.

Optional steps

Network-specific parameters

The DT Exchange adapter supports additional request parameters that can be passed to the adapter as an Android Bundle. The adapter looks for the following keys in the bundle:

Request parameters and values
InneractiveMediationDefs.KEY_AGE Integer. The age of the user
FyberMediationAdapter.KEY_MUTE_VIDEO Boolean. Mute or unmute video

Here's a code example of how to set these ad request parameters:

Java

Bundle extras = new Bundle();
extras.putInt(InneractiveMediationDefs.KEY_AGE, 10);
extras.putBoolean(FyberMediationAdapter.KEY_MUTE_VIDEO, false);

Richiesta di annuncio request = new Richiesta di annuncio.Builder()
       .addNetworkExtrasBundle(FyberMediationAdapter.class, extras)
       .build();

Kotlin

var extras = Bundle()
extras.putInt(InneractiveMediationDefs.KEY_AGE, 10)
extras.putBoolean(FyberMediationAdapter.KEY_MUTE_VIDEO, false)

var adrequest = Richiesta di annuncio.Builder()
       .addNetworkExtrasBundle(FyberMediationAdapter::class.java, extras)
       .build()

Error codes

If the adapter fails to receive an ad from DT Exchange, you can check the underlying error from the ad response using ResponseInfo.getAdapterResponses() under the following class:

com.google.ads.mediation.fyber.FyberMediationAdapter

Here are the codes and accompanying messages thrown by the DT Exchange adapter when an ad fails to load:

Error code Reason
101 DT Exchange server parameters configured in the AdMob UI are missing/invalid.
103 The requested ad size does not match a DT Exchange supported banner size.
105 DT Exchange SDK loaded an ad but returned an unexpected controller.
106 Ad is not ready to display.
200-399 DT Exchange SDK returned an error. See code for more details.

DT Exchange Android Mediation Adapter Changelog

Next version:

  • Pass MobileAds version to DT Exchange SDK.

Version 8.2.7.0

  • Verified compatibility with DT Exchange SDK 8.2.7.

Built and tested with:

  • Google Mobile Ads SDK version 23.0.0.
  • DT Exchange SDK version 8.2.7.

Version 8.2.6.1

  • Updated the minimum required Google Mobile Ads SDK version to 23.0.0.
  • Verified compatibility with DT Exchange SDK 8.2.6.

Built and tested with:

  • Google Mobile Ads SDK version 23.0.0.
  • DT Exchange SDK version 8.2.6.

Version 8.2.6.0

  • Verified compatibility with DT Exchange SDK 8.2.6.

Built and tested with:

  • Google Mobile Ads SDK version 22.6.0.
  • DT Exchange SDK version 8.2.6.

Version 8.2.5.0

  • Verified compatibility with DT Exchange SDK 8.2.5.

Built and tested with:

  • Google Mobile Ads SDK version 22.5.0.
  • DT Exchange SDK version 8.2.5.

Version 8.2.4.0

  • Verified compatibility with DT Exchange SDK 8.2.4.

Built and tested with:

  • Google Mobile Ads SDK version 22.3.0.
  • DT Exchange SDK version 8.2.4.

Version 8.2.3.0

  • Updated adapter to use new VersionInfo class.
  • Updated the minimum required Google Mobile Ads SDK version to 22.0.0.

Built and tested with:

  • Google Mobile Ads SDK version 22.0.0.
  • DT Exchange SDK version 8.2.3.

Version 8.2.2.1

  • Added support for passing muteVideo key in mediation extra to mute interstitial ads.

Built and tested with:

  • Google Mobile Ads SDK version 21.5.0.
  • DT Exchange SDK version 8.2.2.

Version 8.2.2.0

  • Verified compatibility with DT Exchange SDK 8.2.2.
  • Updated the minimum required Google Mobile Ads SDK version to 21.5.0.

Built and tested with:

  • Google Mobile Ads SDK version 21.5.0.
  • DT Exchange SDK version 8.2.2.

Version 8.2.1.0

  • Rebranded adapter name to "DT Exchange".
  • Verified compatibility with DT Exchange SDK 8.2.1.
  • Updated the minimum required Google Mobile Ads SDK version to 21.3.0.

Built and tested with:

  • Google Mobile Ads SDK version 21.3.0.
  • DT Exchange SDK version 8.2.1.

Version 8.2.0.0

  • Verified compatibility with Fyber SDK 8.2.0.
  • Updated the minimum required Google Mobile Ads SDK version to 21.1.0.

Built and tested with:

  • Google Mobile Ads SDK version 21.1.0.
  • Fyber SDK version 8.2.0.

Version 8.1.5.0

  • Verified compatibility with Fyber SDK 8.1.5.

Built and tested with:

  • Google Mobile Ads SDK version 21.0.0.
  • Fyber SDK version 8.1.5.

Version 8.1.4.0

  • Verified compatibility with Fyber SDK 8.1.4.

Built and tested with:

  • Google Mobile Ads SDK version 21.0.0.
  • Fyber SDK version 8.1.4.

Version 8.1.3.1

  • Updated compileSdkVersion and targetSdkVersion to API 31.
  • Updated the minimum required Google Mobile Ads SDK version to 21.0.0.
  • Updated the minimum required Android API level to 19.

Built and tested with:

  • Google Mobile Ads SDK version 21.0.0.
  • Fyber SDK version 8.1.3.

Version 8.1.3.0

  • Verified compatibility with Fyber SDK 8.1.3.
  • Updated the minimum required Google Mobile Ads SDK version to 20.6.0.

Built and tested with:

  • Google Mobile Ads SDK version 20.6.0.
  • Fyber SDK version 8.1.3.

Version 8.1.2.0

  • Verified compatibility with Fyber SDK 8.1.2.
  • Updated the minimum required Google Mobile Ads SDK version to 20.5.0.

Built and tested with:

  • Google Mobile Ads SDK version 20.5.0.
  • Fyber SDK version 8.1.2.

Version 8.1.0.0

  • Verified compatibility with Fyber SDK 8.1.0.

Built and tested with:

  • Google Mobile Ads SDK version 20.4.0.
  • Fyber SDK version 8.1.0.

Version 7.8.4.1

  • Fixed an issue where the adapter would not initialize if there is a duplicate or more than one unique app ID from the mediation configurations.
  • Updated the minimum required Google Mobile Ads SDK version to 20.4.0.

Built and tested with:

  • Google Mobile Ads SDK version 20.4.0.
  • Fyber SDK version 7.8.4.

Version 7.8.4.0

  • Verified compatibility with Fyber SDK 7.8.4.
  • Updated the minimum required Google Mobile Ads SDK version to 20.3.0.
  • Fixed an issue with rewarded display ads, where onVideoComplete() was not called.
  • Fyber now requires an Activity context to show ads.

Built and tested with:

  • Google Mobile Ads SDK version 20.3.0.
  • Fyber SDK version 7.8.4.

Version 7.8.3.0

  • Verified compatibility with Fyber SDK 7.8.3.
  • Added standardized adapter error codes and messages.
  • Updated the minimum required Google Mobile Ads SDK version to 20.1.0.

Built and tested with:

  • Google Mobile Ads SDK version 20.1.0.
  • Fyber SDK version 7.8.3.

Version 7.8.2.0

  • Verified compatibility with Fyber SDK 7.8.2.
  • Updated the minimum required Google Mobile Ads SDK version to 20.0.0.

Built and tested with:

  • Google Mobile Ads SDK version 20.0.0.
  • Fyber SDK version 7.8.2.

Version 7.8.1.0

  • Verified compatibility with Fyber SDK 7.8.1.

Built and tested with:

  • Google Mobile Ads SDK version 19.7.0.
  • Fyber SDK version 7.8.1.

Version 7.8.0.0

  • Verified compatibility with Fyber SDK 7.8.0.
  • Updated the minimum required Google Mobile Ads SDK version to 19.7.0.

Built and tested with:

  • Google Mobile Ads SDK version 19.7.0.
  • Fyber SDK version 7.8.0.

Version 7.7.4.0

  • Verified compatibility with Fyber SDK 7.7.4.
  • Fixed an issue where onUserEarnedReward() is forwarded twice for rewarded ads.

Built and tested with:

  • Google Mobile Ads SDK version 19.5.0.
  • Fyber SDK version 7.7.4.

Version 7.7.3.0

  • Verified compatibility with Fyber SDK 7.7.3.

Built and tested with:

  • Google Mobile Ads SDK version 19.5.0.
  • Fyber SDK version 7.7.3.

Version 7.7.2.0

  • Verified compatibility with Fyber SDK 7.7.2.
  • Updated the minimum required Google Mobile Ads SDK version to 19.5.0.

Built and tested with:

  • Google Mobile Ads SDK version 19.5.0.
  • Fyber SDK version 7.7.2.

Version 7.7.1.0

  • Verified compatibility with Fyber SDK 7.7.1.
  • Updated the minimum required Google Mobile Ads SDK version to 19.4.0.

Built and tested with:

  • Google Mobile Ads SDK version 19.4.0.
  • Fyber SDK version 7.7.1.

Version 7.7.0.0

  • Verified compatibility with Fyber SDK 7.7.0.

Built and tested with:

  • Google Mobile Ads SDK version 19.3.0.
  • Fyber SDK version 7.7.0.

Version 7.6.1.0

  • Verified compatibility with Fyber SDK 7.6.1.

Built and tested with:

  • Google Mobile Ads SDK version 19.3.0.
  • Fyber SDK version 7.6.1.

Version 7.6.0.0

  • Verified compatibility with Fyber SDK 7.6.0.
  • Updated the adapter to support inline adaptive banner requests.
  • Updated the minimum required Google Mobile Ads SDK version to 19.3.0.
  • Fixed a bug where onAdOpened()/onAdClosed() methods were not being called for banner ads.

Built and tested with:

  • Google Mobile Ads SDK version 19.3.0.
  • Fyber SDK version 7.6.0.

Version 7.5.4.0

  • Verified compatibility with Fyber SDK 7.5.4.
  • Updated the minimum required Google Mobile Ads SDK version to 19.1.0.

Built and tested with:

  • Google Mobile Ads SDK version 19.1.0.
  • Fyber SDK version 7.5.4.

Version 7.5.3.0

  • Verified compatibility with Fyber SDK 7.5.3.

Built and tested with:

  • Google Mobile Ads SDK version 19.0.1.
  • Fyber SDK version 7.5.3.

Version 7.5.2.0

  • Verified compatibility with Fyber SDK 7.5.2.
  • Updated the minimum required Google Mobile Ads SDK version to 19.0.1.

Built and tested with:

  • Google Mobile Ads SDK version 19.0.1.
  • Fyber SDK version 7.5.2.

Version 7.5.0.0

  • Verified compatibility with Fyber SDK 7.5.0.
  • Fixed NullPointerException crash during Fyber ad loading.

Built and tested with:

  • Google Mobile Ads SDK version 18.3.0.
  • Fyber SDK version 7.5.0.

Version 7.4.1.0

  • Verified compatibility with Fyber SDK 7.4.1.
  • Updated the minimum required Google Mobile Ads SDK version to 18.3.0.

Built and tested with:

  • Google Mobile Ads SDK version 18.3.0.
  • Fyber SDK version 7.4.1.

Version 7.3.4.0

  • Initial release!
  • Supports Banner, Interstitial and Rewarded ads.

Built and tested with:

  • Google Mobile Ads SDK version 18.2.0.
  • Fyber SDK version 7.3.4.