为帮助发布商遵守《加州消费者隐私法案》(CCPA),Google 移动广告 SDK 允许发布商使用两种不同的参数来指明 Google 是否应启用受限的数据处理。借助该 SDK,发布商可以利用以下信号在广告请求一级设置 RDP:
- Google 的 RDP
- IAB 定义的
IABUSPrivacy_String
无论使用哪种参数,Google 都会对某些唯一标识符的使用方式进行限制,并会在向您提供服务时更为严格地处理数据。因此,Google 将仅展示非个性化广告。这些参数会替换界面中的 RDP 设置。
发布商应自行决定受限的数据处理如何为其合规性计划提供支持以及应在何时启用。这两种可选参数可同时使用,尽管它们对 Google 的广告投放而言效果相同。
本指南旨在帮助发布商了解针对每个广告请求启用这些选项所需的步骤。
RDP 信号
您可以通过以下两种方式通知 Google 应使用 Google 的 RDP 信号启用 RDP:
RDP 的额外参数
对于 extras 参数选项,创建一个用于指定额外参数的广告请求,其中键为 rdp
,值为 1
。
Java
Bundle networkExtrasBundle = new Bundle(); networkExtrasBundle.putInt("rdp", 1); AdRequest request = new AdRequest.Builder() .addNetworkExtrasBundle(AdMobAdapter.class, networkExtrasBundle) .build();
Kotlin
val networkExtrasBundle = Bundle() networkExtrasBundle.putInt("rdp", 1) val request = AdRequest.Builder() .addNetworkExtrasBundle(AdMobAdapter::class.java!!, networkExtrasBundle) .build()
加载广告时,请务必使用此请求对象。
RDP 的共享偏好设置
对于共享偏好设置选项,将值为 1
的 gad_rdp
键写入 SharedPreferences
。移动广告加载期间,Google 移动广告 SDK 会读取 gad_rdp
键。
Java
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(context); sharedPref.edit().putInt("gad_rdp", 1).apply();
Kotlin
val sharedPref = PreferenceManager.getDefaultSharedPreferences(context) sharedPref.edit().putInt("gad_rdp", 1).apply()
IAB 信号
您可以通过以下两种方式通知 Google 应使用 IAB 的信号启用 RDP:
- 添加 IAB 的 extras 参数
- 使用 IAB 的共享偏好设置
IAB 的 Extras 参数
对于 extras 参数选项,创建一个用于指定额外参数的广告请求,其中包含键 IABUSPrivacy_String
和符合 IAB 规范的字符串值。
Java
Bundle networkExtrasBundle = new Bundle(); networkExtrasBundle.putString("IABUSPrivacy_String", iab string); AdRequest request = new AdRequest.Builder() .addNetworkExtrasBundle(AdMobAdapter.class, networkExtrasBundle) .build();
Kotlin
val networkExtrasBundle = Bundle() networkExtrasBundle.putString("IABUSPrivacy_String", iab string) val request = AdRequest.Builder() .addNetworkExtrasBundle(AdMobAdapter::class.java!!, networkExtrasBundle) .build()
加载广告时,请务必使用此请求对象。
IAB 共享偏好设置
对于共享偏好设置选项,使用符合 IAB 规范的字符串值将键 IABUSPrivacy_String
写入 SharedPreferences
。移动广告加载期间,Google 移动广告 SDK 会读取 IABUSPrivacy_String
键。
Java
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(context); sharedPref.edit().putString("IABUSPrivacy_String", iab string).apply();
Kotlin
val sharedPref = PreferenceManager.getDefaultSharedPreferences(context) sharedPref.edit().putString("IABUSPrivacy_String", iab string).apply()
中介
如果您使用中介: