将 Nend 与中介集成

本指南介绍了如何使用 Google 移动广告 SDK 通过中介从 nend 加载和展示广告,其中包括广告瀑布流集成。该指南介绍了如何向广告单元的中介配置添加 nend,以及如何将 nend SDK 和适配器集成到 Unity 应用中。

Nend 的信息中心界面使用日语文本作为其标签、按钮和说明,并且下面显示的屏幕截图尚未翻译。不过,在本指南的文本中,标签和按钮通过其英文名称进行引用。例如,“网址 すーム”是“网址架构”等。

支持的集成和广告格式

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

要求

  • Unity 4 或更高版本
  • 最新版 Google 移动广告 SDK
  • 在 Android 上部署
    • Android API 级别 19 或更高级别
  • 在 iOS 上部署
    • iOS 部署目标为 12.0 或更高版本
  • 一个配置了 Google 移动广告 SDK 且处于有效状态的 Unity 项目。如需了解详情,请参阅开始使用
  • 完成中介 入门指南

第 1 步:在 Nend 界面中设置配置

Sign up or sign in to your nend account.

To add your application to the nend dashboard, first click the Placement Management tab, and then select Site/App. Click the Add an app button to add your app to nend.

Create an application

Enter the name of your app and choose your app platform as the application type. Enter the URL and check if your app is listed on the appropriate app store

(see nend's unreleased apps FAQ if your app has not yet been released). Select a category for your app and click Create when done.

Android

iOS

Your application will be shown on the dashboard once it is created.

Android

iOS

Create a placement

Once the app is registered, you can move on to creating a placement. To create a placement for banner ads, go to the Placement Management tab and click the Placement. Then click the Create a new placement button.

Select your app in the drop-down menu. Then, follow the instructions below that corresponds to your preferred ad format.

Choose Still image for the Ad type, and Banner for the Inventory type. Once that's done, enter a Placement Name, fill out the Introduction to inventory, choose an Inventory format, and finally choose an Inventory size. When finished, click the Create button to create your placement.

Interstitial

Choose Still image for the Ad type, and Interstitial for the Inventory type. Once that's done, enter a Placement Name, fill out the Introduction to inventory, and select an Ad display frequency from the drop-down list. When finished, click the Create button to create your placement.

For Interstitial video ads, choose Video for the Ad type, and Interstitial for the Inventory type. Once that's done, enter a Placement Name, fill out the Introduction to inventory, and choose an appropriate a Category from the drop-down list. When finished, click the Create button to create your placement.

Rewarded

Choose Video for the Ad type, and Reward for the Inventory type. Once that's done, enter a Placement Name, fill out the Introduction to inventory, and choose an appropriate a Category from the drop-down list.

Under Reward settings, select a Reward content using the drop-down list, enter your preferred Virtual currency name. When finished, click the Create button to create your placement.

Native

Choose Still image for the Ad type, and Native for the Inventory type. Once that's done, enter a Placement Name, fill out the Introduction to inventory, and select a Ad image selection. When finished, click the Create button to create your placement.

For Native video ads, choose Video for the Ad type, and Native (custom) for the Inventory type. Once that's done, enter a Placement Name, fill out the Introduction to inventory, and choose an appropriate a Category from the drop-down list.

Under Native settings, select a Video ad orientation and Native ad type from the list. When finished, click the Create button to create your placement.

To set up your AdMob ad unit in the next section, you'll need the apiKey and spotID for each placement. To locate them, head to the Placement Management tab and select the SDK button under the name of your app.

Take note of the apiKey and spotID.

You'll also need your API Key for nend's reporting API, which they call the API Key for Scraping. You can find it in the Tools tab.

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

为广告单元配置中介设置

Android

如需了解相关说明,请参阅 Android 指南中的第 2 步。

iOS

如需了解相关说明,请参阅 iOS 指南中的第 2 步。

第 3 步:导入 nend SDK 和适配器

请访问更新日志中的下载链接,下载适用于 nend 的最新版 Google 移动广告中介插件,然后从 zip 文件中提取 GoogleMobileAdsNendMediation.unitypackage 软件包。

在 Unity 项目编辑器中,依次选择 Assets > Import Package > Custom Package,然后找到您下载的 GoogleMobileAdsNendMediation.unitypackage 文件。确保选择所有文件,然后点击 Import

然后,依次选择 Assets > Play Services Resolver > Android Resolver > Force Resolve。Unity Play 服务解析器库将从头开始执行依赖项解析,并将声明的依赖项复制到 Unity 应用的 Assets/Plugins/Android 目录中。

第 4 步:添加所需的代码

Android

Nend 集成不需要其他代码。

iOS

SKAdNetwork 集成

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

第 5 步:测试您的实现

启用测试广告

请务必为 AdMob。 若要获取横幅广告、插页式广告和激励广告的测试广告,Nend 建议您使用 Nend 测试广告单元 页面中提供的 API 密钥和 Spot ID。您可以在测试时输入这些 API 密钥和 Spot ID 作为 AdMob 广告单元的 API 密钥和 Spot ID,然后在您的应用准备好投入生产环境后替换为实际的 API 密钥和 Spot ID。

验证测试广告

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

错误代码

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

Android

com.google.ads.mediation.nend.NendAdapter
com.google.ads.mediation.nend.NendRewardedAdapter
com.google.ads.mediation.nend.NendMediationAdapter

iOS

GADMAdapterNend
GADMAdapterNend
GADMAdapterNendRewarded
GADMediationAdapterNend

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

Android

错误代码 网域 原因
101 com.google.ads.mediation.nend 需要活动上下文才能加载和展示广告。
102 com.google.ads.mediation.nend 在界面中配置的 AdMob 服务器参数缺失/无效。
103 com.google.ads.mediation.nend 尚未准备好展示。
104 com.google.ads.mediation.nend 无法播放广告。
105 com.google.ads.mediation.nend 请求的广告尺寸与支持的横幅广告尺寸不匹配。
106 com.google.ads.mediation.nend Context 对象引用为 null 并且/或者最近已从内存中释放。
200-299 net.nend.android Nend SDK 返回了插页式广告加载错误。如需了解详情,请参阅代码
300-399 net.nend.android Nend SDK 返回了插页式广告错误。如需了解详情,请参阅代码
400-499 net.nend.android Nend SDK 返回了广告错误。如需了解详情,请参阅代码

iOS

错误代码 网域 原因
101 com.google.mediation.nend Nend SDK 返回了一个加载失败回调,并且没有其他错误信息。
102 com.google.mediation.nend Nend SDK 返回了一个显示失败回调,并且不包含其他错误信息。
103 com.google.mediation.nend 在界面中配置的 AdMob 服务器参数缺失/无效。
104 com.google.mediation.nend 未能加载原生广告图片素材资源。
105 com.google.mediation.nend 由于广告尚未就绪,未能展示 Nend 广告。
106 com.google.mediation.nend 请求的横幅广告尺寸与支持的横幅广告尺寸不匹配。
200-699 由 nend SDK 发送。 Nend SDK 返回错误。如需了解详情,请参阅 Nend 的文档

nend Unity 中介插件更新日志

版本 8.0.0

版本 7.0.0

版本 6.0.1

版本 6.0.0

版本 5.2.0

版本 5.1.0

版本 5.0.0

版本 4.0.1

版本 4.0.0

版本 3.0.0

版本 2.3.0

版本 2.2.0

版本 2.1.0

  • 更新了插件以支持新的激励广告 API。
  • 支持 nend Android 适配器版本 5.1.0.2。
  • 支持 nend iOS 适配器版本 5.1.1.0。

版本 2.0.3

  • 支持 nend Android 适配器版本 5.0.2.1。
  • 支持 nend iOS 适配器版本 5.0.2.0。

版本 2.0.2

  • 支持 nend Android 适配器版本 5.0.2.0。
  • 支持 nend iOS 适配器版本 5.0.2.0。

版本 2.0.1

  • 支持 nend Android 适配器版本 5.0.2.0。
  • 支持 nend iOS 适配器版本 5.0.1.0。

版本 2.0.0

  • 支持 nend Android 适配器版本 5.0.0.0。
  • 支持 nend iOS 适配器版本 5.0.0.0。

版本 1.0.2

  • 支持 nend Android 适配器版本 4.0.5.0。
  • 支持 nend iOS 适配器版本 4.0.6.0。

版本 1.0.1

  • 支持 nend Android SDK 版本 4.0.4。
  • 支持 nend iOS SDK 4.0.4 版。

版本 1.0.0

  • 首个版本!
  • 支持 nend Android SDK 版本 4.0.2。
  • 支持 nend iOS SDK 4.0.2 版。