Integrate DT Exchange with mediation

本指南将向您介绍如何使用 Google 移动广告 SDK,利用涉及广告瀑布流集成的中介从 DT Exchange 加载和展示广告。它介绍了如何将 DT Exchange 添加到广告单元的中介配置中,以及如何将 DT Exchange SDK 和适配器集成到应用中。 Flutter

支持的集成和广告格式

适用于 DT Exchange 的 AdMob 中介适配器具有以下功能:

集成
出价
瀑布
表现形式
横幅
插页式广告
已奖励

要求

  • 最新版 Google 移动广告 SDK
  • Flutter 3.7.0 或更高版本
  • 在 Android 上部署
    • Android API 级别 21 或更高级别
  • 在 iOS 上部署
    • iOS 部署目标为 12.0 或更高版本
  • 配置了 Google 移动广告 SDK 的有效 Flutter 项目。如需了解详情,请参阅使用入门
  • 完成中介 入门指南

第 1 步:在 DT Exchange 界面中设置配置

Add new app and ad placement

Sign up or log in to DT Exchange Console.

Click on the Add App button to add your app.

Manage Apps

Select your Platform, fill out the rest of the form, and click Add Placements.

Android

iOS

Enter a name for the new placement in the field labeled Name your Placement and select your desired Placement Type from the dropdown list. Finally, click Save Placement.

Setup

App ID and Placement ID

Open the left navigation bar by hovering your mouse over it. Then click Apps from the left menu.

Menu

On the App Management page, take note of the App ID next to your app.

App ID

Select your app, navigate to the Placements tab, and click on the copy icon next to Placement Name. Take note of the Placement ID.

Placement ID

Publisher ID, Consumer Key and Consumer Secret

Click on your username from the left menu and select User Profile.

User Profile Menu

Take note of the Publisher ID, Consumer Key, and Consumer Secret as these are needed in the next step.

User Profile

第 2 步:在界面中设置 DT Exchange 需求 AdMob

Configure mediation settings for your ad unit

Android

For instructions, see step 2 in the guide for Android.

iOS

For instructions, see step 2 in the guide for iOS.

添加到 GDPR 和美国州级法规的广告合作伙伴列表中 Fyber

Follow the steps in GDPR settings and US state regulations settings to add Fyber to the GDPR and US state regulations ad partners list in the AdMob UI.

第 3 步:导入 DT Exchange SDK 和适配器

Integration through pub.dev

Add the following dependency with the latest versions of the DT Exchange SDK and adapter in your package's pubspec.yaml file:

dependencies:
  gma_mediation_dtexchange: ^1.0.0

Manual Integration

Download the latest version of Google Mobile Ads mediation plugin for DT Exchange, extract the downloaded file, and add the extracted plugin folder (and its contents) to your Flutter project. Then, reference the plugin in your pubspec.yaml file by adding the following dependency:

dependencies:
  gma_mediation_dtexchange:
    path: path/to/local/package

第 4 步:在 DT Exchange SDK 上实现隐私设置

根据 Google 欧盟地区用户意见征求政策,您必须确保就设备标识符和个人数据的使用向欧洲经济区 (EEA) 用户披露特定披露信息,并征得其同意。此政策反映了欧盟《电子隐私指令》和《一般数据保护条例》(GDPR) 的要求。在征求用户意见时,您必须指明中介链中可能会收集、接收或使用个人数据的各个广告联盟,并提供有关每个广告联盟使用情况的信息。Google 目前无法自动将用户的同意情况传送给此类广告联盟。

适用于 DT Exchange 的 Google 移动广告中介插件不支持向 DT Exchange SDK 传递用户意见信息。

美国州级隐私保护法律

美国州级隐私保护法律 规定,必须让用户有权选择不“出售”其“个人信息”(该法律对这些术语进行了定义)。“出售”方须在首页醒目位置提供“请勿出售我的个人信息”链接,以供用户选择。美国州级隐私保护法律合规性指南让您可以为 Google 广告投放启用受限的数据处理,但 Google 无法将此设置应用于中介链中的每个广告联盟。因此,您必须确定中介链中可能参与个人信息出售的每个广告网络,并遵循每个广告网络的指导以确保合规性。

适用于 DT Exchange 的 Google 移动广告中介插件不支持向 DT Exchange SDK 传递用户意见信息。

第 5 步:添加所需的代码

Android

DT Exchange 集成无需额外的代码。

iOS

SKAdNetwork 集成

按照 DT Exchange 的文档操作,将 SKAdNetwork 标识符添加到项目的 Info.plist 文件中。

第 6 步:测试实现效果

Enable test ads

Make sure you register your test device for AdMob.

Verify test ads

To verify that you are receiving test ads from DT Exchange, enable single ad source testing in ad inspector using the DT Exchange (Waterfall) ad source(s).

错误代码

如果适配器无法从 DT Exchange 接收广告,发布商可以使用以下类下的 ResponseInfo 检查广告响应的根本错误:

Android

com.google.ads.mediation.fyber.FyberMediationAdapter

iOS

GADMediationAdapterFyber

以下是广告加载失败时 DT Exchange 适配器抛出的代码及相应消息:

Android

错误代码 原因
101 在界面中配置的 DT Exchange 服务器参数缺失/无效。 AdMob
103 请求的广告尺寸与 DT Exchange 支持的横幅广告尺寸不匹配。
105 DT Exchange SDK 加载了广告,但返回了意外的控制器。
106 广告尚未准备好,无法展示。
200-399 DT Exchange SDK 返回了错误。如需了解详情,请参阅代码

iOS

错误代码 原因
0-10 DT Exchange SDK 返回了错误。如需了解详情,请参阅文档
101 在界面中配置的 DT Exchange 服务器参数缺失/无效。 AdMob
102 请求的广告尺寸与 DT Exchange 支持的横幅广告尺寸不匹配。
103 未能展示广告,因为广告对象已被使用。
104 由于广告未准备就绪,未能展示 DT Exchange 广告。
105 DT Exchange SDK 返回了初始化错误。

1.0.0

  • 初始版本。
  • 已验证与 DT Exchange Android 适配器版本 8.2.6.1 的兼容性
  • 经过验证的 DT Exchange iOS 适配器版本 8.2.7.0 的兼容性