将 Yahoo 与中介集成

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 Ad Manager mediation adapter for Yahoo has the following capabilities:

Integration
Bidding
Waterfall
Formats
Banner
Interstitial
Rewarded
Native

Requirements

  • Android API level 19 or higher

Step 1: Set up configurations in Yahoo UI

Log in to Yahoo's SSP. Under Applications and Sites, click the + button then Application.

Fill out the form and click Save and Add Placement to create your app.

Once you've created an app, you will need to create a Placement. Select a Placement Type, fill out the form, and click Save & Monetize.

Take note of your Placement ID.

You will need to add an Ad Source to your placement. On the next form, select Yahoo SSP as an Ad Source and fill out the form with the required information. Once you've completed the form, click Save.

Finally, drag the Ad Source that you just created under the Waterfall Ad Sources table to add it to your placement.

Take note of the Site ID.

Turn on test mode

Yahoo ads can be tested by creating a Test Ad Source and adding it into your placement's Waterfall Ad Sources. Navigate to your Placement ID's settings, click the Add button and select Test Ad Source.

Once you've created the Ad Source, drag it into your placement's Waterfall Ad Sources.

That's it! You now have a working mediation integration with Yahoo.

Step 2: Set up Yahoo demand in Ad Manager UI

为广告单元配置中介设置

登录您的 Ad Manager 帐号

依次转到投放 > 收益组,然后点击新建收益组按钮。

为您的收益组输入一个独一无二的名称,将状态设为有效,选择广告格式,然后将广告资源类型设为移动应用。在定位 > 广告资源部分下,选择广告资源移动应用(您要向其中添加中介)下方的广告单元。

接下来,点击添加收益合作伙伴按钮。

如果您已有 Yahoo - App & Display 的收益合作伙伴,可以选择它。否则,请选择创建新的收益合作伙伴

选择 Yahoo - App & Display 作为广告联盟,输入一个具有唯一性的名称并启用中介

选择收益合作伙伴后,选择移动 SDK 中介作为集成类型,选择 Android 作为平台,选择有效作为状态。输入在上一部分获得的Placement ID and Site ID 。然后,输入默认每千次展示费用值。

完成后,点击页面底部的保存

Add Yahoo to GDPR and US state regulations ad partners list

按照 GDPR 设置美国州级法规设置 中的步骤,将 Yahoo 添加到 Ad Manager 界面中的 GDPR 和美国州级法规广告合作伙伴列表中。

Step 3: Import the Yahoo Mobile SDK and adapter

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

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

启用测试广告

请务必为Ad Manager 注册您的测试设备,并在 Yahoo - App & Display 界面中启用测试模式

验证测试广告

如需验证您收到的是来自 Yahoo - App & Display 的测试广告,请使用相应广告来源在广告检查器中启用单一广告来源测试Yahoo (Waterfall)

Optional steps

Using native ads

Ad rendering

The Yahoo adapter returns its native ads as NativeAd objects. It populates the following fields 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.