指定目標

本指南說明如何為廣告請求提供指定目標資訊。

必要條件

  • 完成「開始使用」

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 和再行銷廣告。

RequestConfiguration 結構的 tag_for_child_directed_treatment 成員指派給下列其中一個列舉值,即可進行設定:

  • RequestConfiguration::tag_for_child_directed_treatment 指派給 RequestConfiguration::kChildDirectedTreatmentTrue,表明您希望系統基於 COPPA 規定,將內容視為兒童導向內容。
  • RequestConfiguration::tag_for_child_directed_treatment 指派給 RequestConfiguration::kChildDirectedTreatmentFalse,表示您不希望我們以 COPPA 為兒童導向的內容。
  • 如果不想表明在廣告請求中應如何處理 COPPA 規範的內容,請將 RequestConfiguration::tag_for_child_directed_treatment 指派給 RequestConfiguration::kChildDirectedTreatmentUnspecified

下列示例說明,您希望內容因 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 對發布商的影響

使用這項功能時,廣告請求將包含未滿 15 歲 (未滿 15 歲) 使用者的代碼;這個參數會停用所有廣告請求的個人化廣告 (包括再行銷)。並且停止向第三方廣告供應商 (例如廣告評估像素和第三方廣告伺服器) 提出其他請求。

與兒童導向設定一樣,RequestConfiguration 中的一個成員在設定 TFUA 參數時有成員:tag_for_under_age_of_consent,這個參數可以使用下列列舉值進行設定:

  • RequestConfiguration::tag_for_under_age_of_consent 指派給 RequestConfiguration::kUnderAgeOfConsentTrue,以表明您希望廣告請求為未滿規定年齡的歐洲經濟區使用者接收實驗組。
  • RequestConfiguration::tag_for_under_age_of_consent 指派給 RequestConfiguration::kUnderAgeOfConsentFalse,表明您希望廣告請求不會為未滿規定年齡的歐洲經濟區使用者接收處理方式。
  • 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();