This guide shows you how to use the Google Mobile Ads SDK to load and display ads from Yahoo using mediation, covering waterfall integrations. It covers how to add Yahoo to an ad unit's mediation configuration, and how to integrate the Yahoo Mobile SDK and adapter into an Android app.
Supported integrations and ad formats
The AdMob mediation adapter for Yahoo has the following capabilities:
Integration | |
---|---|
Bidding | |
Waterfall | |
Formats | |
Banner | |
Interstitial | |
Rewarded | |
Native |
Requirements
- Android API level 19 or higher
Latest Google Mobile Ads SDK
Complete the mediation Get started guide
Step 1: Set up configurations in Yahoo UI
登录 Yahoo 的 SSP。在应用和网站下,点击 + 按钮,然后点击应用。
填写表单,然后点击 Save and Add Placement(保存并添加展示位置)以创建您的应用。
创建应用后,您需要创建 Placement。选择展示位置类型,填写表单,然后点击保存并获利。
记下您的展示位置 ID。
您需要向展示位置添加广告来源。在下一个表单中,选择 Yahoo SSP 作为广告来源,然后在表单中填写所需的信息。填写完表单后,请点击保存。
最后,将您刚刚创建的广告来源拖动到 Waterfall 广告来源表格下方,将其添加到您的展示位置。
记下网站 ID。
开启测试模式
要测试 Yahoo 广告,可以创建一个测试广告来源,并将其添加到您展示位置的瀑布流广告来源中。转到展示位置 ID 的设置页面,点击添加按钮,然后选择测试广告来源。
创建广告来源后,将其拖动到展示位置的瀑布流广告来源中。
大功告成!您现在已经与 Yahoo 实现了有效的中介集成。
Step 2: Set up Yahoo demand in AdMob UI
広告ユニットのメディエーション設定を行う
広告ユニットのメディエーション設定に Yahoo を追加する必要があります。
AdMob アカウントにログインします。次に、[メディエーション] タブに移動します。既存のメディエーション グループを編集する場合は、そのメディエーション グループの名前をクリックして編集し、広告ソースとして Yahoo を追加するに進んでください。
新しいメディエーション グループを作成するには、[メディエーション グループを作成] を選択します。
広告フォーマットとプラットフォームを入力して、[続行] をクリックします。
メディエーション グループに名前を付けて、ターゲットとする地域を選択します。次に、メディエーション グループのステータスを [有効] に設定し、[広告ユニットを追加] をクリックします。
このメディエーション グループを、既存の 1 つ以上の広告ユニット(AdMob )に関連付けます。[完了] をクリックします。
選択した広告ユニットが入力された広告ユニットカードが表示されます。
広告ソースとして Yahoo を追加
[広告ソース] セクションの [ウォーターフォール] カードで、[広告のソースを追加] を選択します。 Yahoo を選択します。
[ Yahoo ] を選択します。 次に、 Yahoo の eCPM の値を入力し、[続行] をクリックします。Yahoo のマッピングがすでにある場合は、それを選択できます。それ以外の場合は、[マッピングを追加] をクリックします。
次に、前のセクションで取得した Placement ID and Site IDを入力します。[完了] をクリックします。
Add Yahoo to GDPR and US state regulations ad partners list
GDPR 設定 米国の州規制の設定 の手順に沿って、 AdMob UI の GDPR および米国の州規制の広告パートナーのリストに Yahoo を追加します。
Step 3: Import the Yahoo Mobile SDK and adapter
Android Studio integration (recommended)
Add the following implementation dependencies with the latest versions of the Yahoo Ads SDK and adapter in the app-level build.gradle file:
repositories { google() mavenCentral() maven { url 'https://artifactory.yahooinc.com/artifactory/maven/' } } ... dependencies { implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'com.google.android.gms:play-services-ads:22.6.0' implementation 'com.google.ads.mediation:yahoo:1.4.1.1' } ...
Manual Integration
To include the Yahoo Mobile SDK, consult the Yahoo Android SDK documentation.
Navigate to the Yahoo adapter artifacts on Google's Maven Repository. Select the latest version, download the Yahoo adapter's
.aar
file, and add it to your project.
Step 4: Implement privacy settings on Yahoo SDK
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.
The following sample code shows how to pass consent information to the Yahoo Mobile SDK. If you choose to call this method, it is recommended that you do so prior to requesting ads through the Google Mobile Ads SDK.
Java
import com.yahoo.ads.YASAds;
import com.yahoo.ads.CcpaConsent;
// ...
CcpaConsent ccpaConsent = new CcpaConsent("<CCPA CONSENT>");
YASAds.addConsent(ccpaConsent);
Kotlin
import com.yahoo.ads.YASAds
import com.yahoo.ads.CcpaConsent
// ...
val ccpaConsent = CcpaConsent("<CCPA CONSENT>")
YASAds.addConsent(ccpaConsent)
See Publisher Privacy Settings for more details and the values that can be provided in the method.
Step 5: Add required code
No additional code required for Yahoo integration.
Step 6: Test your implementation
テスト広告を有効にする
AdMob にテストデバイスを登録し、 Yahoo UI でテストモードを有効にします。
テスト広告を確認する
Yahoo からテスト広告を受信していることを確認するには、広告インスペクタで Yahoo (Waterfall) 広告ソースを使用して単独の広告ソースのテストを有効にします。
Optional steps
Using native ads
Ad rendering
The Yahoo adapter returns its native ads as
NativeAd
objects. It populates the following
Native ads field descriptions
for a
NativeAd
.
Field | Populated by Yahoo adapter |
---|---|
Headline | |
Image | |
Body | |
App icon | |
Call to action | |
Advertiser Name | |
Star rating | |
Store | |
Price |
Yahoo Android Mediation Adapter Changelog
Next Version
- Updated the minimum required Google Mobile Ads SDK version to 22.4.0.
Version 1.4.1.1
- 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.
- Yahoo Mobile SDK 1.4.1.
Version 1.4.1.0
- Rebranded Verizon Media adapter to "Yahoo".
- Added descriptive error codes and reasons for adapter load and show failures.
- Verified compatibility with Yahoo Mobile SDK version 1.4.1.
- 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.
- Yahoo Mobile SDK 1.4.1.