将腾讯 GDT 与中介集成
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本指南面向有兴趣将 Google 移动广告中介与 Tencent GDT 搭配使用的发布商。本指南将逐步介绍如何设置中介适配器以与您当前的 Android 应用搭配使用,以及如何配置其他设置。
前提条件
实用入门指南
以下帮助中心文章提供了有关中介的背景信息:
将腾讯广点通添加到您的项目
包含广告联盟适配器和 SDK
从上述链接下载腾讯广点通 SDK 和适配器。
在 Android Studio 中,将适配器和 SDK 文件添加到项目的 libs
文件夹中。确保您的应用级 Gradle 文件包含以下内容:
Kotlin
dependencies {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.aar", "*.jar"))))
// ...
}
Groovy
dependencies {
implementation fileTree(dir: 'libs', include: ['*.aar', '*.jar'])
// ...
}
按照腾讯 GDT 文档中的说明修改 AndroidManifest.xml
文件。
您的应用无需直接调用腾讯 GDT,Google 移动广告 SDK 会调用腾讯 GDT 适配器来为您提取广告。如有必要,您可以指定任何其他请求参数。本页面的其余部分详细介绍了如何向腾讯 GDT 提供更多信息。
使用 Activity 实例初始化您的广告对象
在新广告对象(例如 AdView
)的构造函数中,您必须传入类型为 Context
的对象。使用中介时,此 Context
会传递到其他广告联盟。某些广告联盟需要类型为 Activity
且条件更严格的 Context
,并且如果没有 Activity
实例,可能无法投放广告。因此,我们建议在初始化广告对象时传入 Activity
实例,以确保从您的所有中介广告联盟获得一致的体验。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-16。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-16。"],[[["This guide explains how to integrate Tencent GDT ads into your Android app using Google Mobile Ads mediation."],["Publishers need an existing Android app with the Google Mobile Ads SDK and an AdMob account with configured mediation line items to begin."],["Integration involves adding the Tencent GDT SDK and adapter to your project, configuring the AndroidManifest.xml, and initializing ad objects with an Activity instance."],["Google Mobile Ads SDK handles communication with the Tencent GDT adapter; publishers don't need to directly interact with Tencent GDT."]]],["This guide details how publishers can integrate Tencent GDT with Google Mobile Ads mediation in Android apps. Key actions include downloading the Tencent GDT SDK and adapter, adding them to the project's `libs` folder, and updating the `AndroidManifest.xml` file as per Tencent GDT's instructions. Additionally, it recommends initializing ad objects with an `Activity` instance for broader ad network compatibility. The Google Mobile Ads SDK manages ad requests via the Tencent GDT adapter.\n"]]