本指南將說明如何向廣告請求提供指定目標資訊。
必要條件
- 完成開始使用。
RequestConfiguration
RequestConfiguration
這個結構體會收集要下載的指定目標資訊
透過 SetRequestConfiguration()
全域函式套用全域
如要更新要求設定,請先取得目前的設定,然後執行所需的更新,並依下列方式設定:
firebase::gma::RequestConfiguration retrieved_configuration = firebase::gma::GetRequestConfiguration(); // .. apply your changes, then: firebase::gma::SetRequestConfiguration(request_configuration);
兒童導向設定
用於《兒童網路隱私保護法》 (COPPA)、 有一項設定是「標記為兒童導向內容」設定。透過設定 標記,即表示您保證這項通知正確無誤,且您有權 代表應用程式擁有者執行動作您瞭解濫用這項設定 我們可能會終止您的 Google 帳戶。
如果您是應用程式開發人員,則可指明是否希望 Google 在您提出廣告請求時將內容視為兒童導向內容。如果您表示希望 Google 將內容視為兒童導向內容,我們會採取措施,針對該廣告請求停用 IBA 和再行銷廣告。
您可以指派
tag_for_child_directed_treatment
個結構體中的「RequestConfiguration
」成員到
下列其中一個列舉值:
- 指派「
RequestConfiguration::tag_for_child_directed_treatment
」給RequestConfiguration::kChildDirectedTreatmentTrue
表示您想要 您的內容將視為兒童導向內容,以符合 COPPA 規範 - 指派「
RequestConfiguration::tag_for_child_directed_treatment
」給RequestConfiguration::kChildDirectedTreatmentFalse
表示 不要在符合 COPPA 規範的情況下,將您的內容視為兒童導向內容。 - 指派「
RequestConfiguration::tag_for_child_directed_treatment
」給RequestConfiguration::kChildDirectedTreatmentUnspecified
如果您不想 中表明,您希望內容在遵守 COPPA 時,應如何處置 廣告請求。
以下範例表示您希望系統將內容視為兒童導向內容,以便遵循 COPPA 規定:
firebase::gma::RequestConfiguration request_configuration = firebase::gma::GetRequestConfiguration(); request_configuration.tag_for_child_directed_treatment = firebase::RequestConfiguration::kChildDirectedTreatmentTrue; firebase::gma::SetRequestConfiguration(request_configuration);
設定這個標記即表示您確認這項通知正確無誤,且您已獲應用程式擁有者授權,可代表對方提出通知。您瞭解如果濫用這項設定,可能會導致 Google 帳戶遭到終止。
未滿法定同意年齡的使用者
您可以替廣告請求設定未滿法定同意年齡的歐洲經濟區使用者標記。這項功能旨在 協助遵守《一般資料保護規則》 (GDPR)。 請注意,您可能也需要配合 GDPR 遵守其他法律義務;請參閱 歐盟的指示,並諮詢您的法律顧問。請 別忘了,Google 工具專為協助遵循法規而設計 解除任何特定發布商的法律義務。瞭解詳情 GDPR 對發布商的影響。
使用這項功能時,廣告請求會包含「未滿法定同意年齡的歐洲使用者標記」(TFUA) 參數。這個參數會針對所有廣告請求停用個人化廣告功能 (包括再行銷),此外, 停止向第三方廣告供應商 (例如廣告評估像素和 第三方廣告伺服器
與兒童導向設定類似,RequestConfiguration 中也有一個成員可用來設定 TFUA 參數:tag_for_under_age_of_consent
,可使用下列列舉值進行設定:
- 將
RequestConfiguration::tag_for_under_age_of_consent
指派給RequestConfiguration::kUnderAgeOfConsentTrue
,表示您希望廣告請求針對歐洲經濟區 (EEA) 境內未滿法定同意年齡的使用者採用受限的資料處理模式。 - 將
RequestConfiguration::tag_for_under_age_of_consent
指派給RequestConfiguration::kUnderAgeOfConsentFalse
,表示您不希望廣告請求針對歐洲經濟區 (EEA) 境內未滿法定同意年齡的使用者採取相關處理模式。 - 指派「
RequestConfiguration::tag_for_under_age_of_consent
」給RequestConfiguration::kUnderAgeOfConsentUnspecified
表示 尚未指定廣告請求是否應針對使用者採取行動 未滿規定年齡的歐洲經濟區 (EEA) 使用者。
以下舉例說明您想在廣告請求中加入 TFUA:
firebase::gma::RequestConfiguration request_configuration = firebase::gma::GetRequestConfiguration(); request_configuration.tag_for_under_age_of_consent = firebase::RequestConfiguration::kUnderAgeOfConsentTrue; firebase::gma::SetRequestConfiguration(request_configuration);
啟用「兒童導向」設定和「未滿法定同意年齡的使用者」的代碼不得同時設為 true。如果是的話,影片就是兒童導向內容 設定的優先順序較高。
廣告內容篩選
應用程式可透過
RequestConfiguration::max_ad_content_rating field
。AdMob 廣告傳回的時間
這個等級的內容分級等於或低於該層級。「可能性」
這個值是依據數位內容標籤分類,必須
下列其中一個列舉值:
RequestConfiguration::kMaxAdContentRatingG
RequestConfiguration::kMaxAdContentRatingPG
RequestConfiguration::kMaxAdContentRatingT
RequestConfiguration::kMaxAdContentRatingMA
以下程式碼會設定 RequestConfiguration
結構體,以指定傳回的廣告內容應對應至數位內容標籤,其等級不得高於 G:
firebase::gma::RequestConfiguration request_configuration = firebase::gma::GetRequestConfiguration(); request_configuration.max_ad_content_rating = firebase::RequestConfiguration::kMaxAdContentRatingG; firebase::gma::SetRequestConfiguration(request_configuration);
AdRequest
AdRequest
物件會收集要與廣告一併傳送的指定目標資訊
請求。
內容網址
請求廣告時,應用程式可能會傳遞所放送內容的網址。這樣可以讓關鍵字指定功能比對廣告與內容。
舉例來說,如果應用程式在顯示 https://www.example.com
的內容時要求廣告,您可以傳遞這個網址,以便指定相關關鍵字:
// AdRequest with content URL: firebase::admob::AdRequest ad_request(/*content_url=*/"https://www.example.com"); // AdRequest without content URL: firebase::admob::AdRequest ad_request();