為協助發布商遵守 美國州級隱私權法律, Google Mobile Ads SDK 可讓發布商使用兩種不同的參數,指明 Google 是否應啟用受限的資料處理 (RDP)。發布商可運用下列信號,在廣告請求層級設定遠端桌面協定:
- Google 的遠端桌面協定
- IAB 定義
IABUSPrivacy_String
使用某個參數時,Google 會限制參數在向發布商佈建服務時處理的特定專屬 ID 和其他資料。 因此,Google 只會顯示非個人化廣告。這些參數會覆寫 UI 中的 RDP 設定。
發布商應自行判斷「受限的資料處理」模式如何支援他們的法規遵循計畫,以及何時應啟用。您可以同時使用這兩種選填參數,不過這兩個參數對 Google 廣告放送功能的效果相同。
本指南旨在協助發布商瞭解為個別廣告請求啟用這些選項的必要步驟。
遠端桌面協定信號
有兩種方式可以通知 Google 使用 Google 的 RDP 信號啟用 RDP:
遠端桌面協定的 Extras 參數
針對 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()
載入廣告時,請務必使用這個要求物件。
遠端桌面協定的共用偏好設定
針對共用偏好設定選項,請將 1
索引鍵 gad_rdp
的值寫入 SharedPreferences
。Google Mobile Ads 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 的額外參數
- 使用 IAB 的共用偏好設定
IAB 額外項目參數
針對 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 Mobile Ads 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()
調解
如果您使用中介服務: