指定目標

選取平台: Android iOS Unity Flutter

RequestConfiguration 物件會收集每個廣告請求的全域設定,並由 MobileAds.instance.updateRequestConfiguration() 套用。

為確保所有廣告請求都套用相關設定變更,請先更新請求設定,再初始化 Mobile Ads SDK

兒童導向內容設定

根據兒童網路隱私保護法 (COPPA),系統提供「兒童導向內容標記」設定。

應用程式開發人員可以在傳送廣告請求時,指明是否希望 Google 將內容標為兒童導向。如果選擇將內容視為兒童導向,Google 就會採取必要措施,停用該廣告請求的 IBA 和再行銷廣告。這項設定適用於透過 RequestConfiguration.tagForChildDirectedTreatment() 使用的所有版本 Google Play 服務 SDK:

  • 使用 TagForChildDirectedTreatment.yes 引數,指明要根據 COPPA 將內容視為兒童導向。
  • 使用 TagForChildDirectedTreatment.no 引數,指明不要根據 COPPA 將內容視為兒童導向。
  • 如不想在廣告請求中指明是否依 COPPA 規定處理內容,請使用 TagForChildDirectedTreatment.unspecified 引數,或不要設定這個代碼。

以下範例說明如何依 COPPA 規定,標示兒童導向內容:

final RequestConfiguration requestConfiguration = RequestConfiguration(
  tagForChildDirectedTreatment: TagForChildDirectedTreatment.yes);
MobileAds.instance.updateRequestConfiguration(requestConfiguration);

針對未滿規定年齡的歐洲經濟區使用者,您可以在廣告請求中加上相關處理標記。這項功能的立意是協助發布商遵守《一般資料保護規則》(GDPR)。請注意,您可能還有 GDPR 所衍生的其他法律義務。請查看歐盟發布的指南並諮詢您的法律顧問。提醒您,Google 提供工具的用意是協助發布商遵守規定,而非方便發布商規避法定義務。進一步瞭解 GDPR 對發布商的影響

使用這項功能時,廣告請求會包含歐洲使用者適用的「未滿規定年齡標記」(TFUA) 參數。這個參數會針對特定廣告請求,停用個人化廣告功能 (包括再行銷)。並停止向第三方廣告供應商 (例如廣告評估像素和第三方廣告伺服器) 提出其他請求。

使用 RequestConfiguration.tagForUnderAgeOfConsent() 設定代碼:

  • 使用 TagForUnderAgeOfConsent.yes 引數,指明您希望以適合未滿規定年齡使用者的方式處理請求設定。
  • 使用 TagForUnderAgeOfConsent.no 引數,指明您不希望以適合未滿規定年齡使用者的方式處理請求設定。
  • 使用 TagForUnderAgeOfConsent.unspecified 引數或不設定這個標記,表示您未指定廣告請求是否應對歐洲經濟區 (EEA) 未滿規定年齡的使用者,採取相應措施。以下範例說明如何在廣告請求中加入 TFUA:

    final RequestConfiguration requestConfiguration = RequestConfiguration(
      tagForUnderAgeOfConsent: TagForUnderAgeOfConsent.yes);
    MobileAds.instance.updateRequestConfiguration(requestConfiguration);
    

用於啟用兒童導向內容設定和 setTagForUnderAgeOfConsent 的標記,不可同時設為 true,否則將優先採用兒童導向內容設定。

廣告內容篩選

您可以使用 RequestConfiguration.maxAdContentRating() 設定廣告內容分級:

系統為這些請求傳回的 AdMob 廣告,就不會超過指定的內容分級上限。這項聯播網額外資訊可能的值取決於數位內容標籤分類,且可為下列 MaxAdContentRating 物件之一:

  • MaxAdContentRating.g
  • MaxAdContentRating.pg
  • MaxAdContentRating.t
  • MaxAdContentRating.ma

下列程式碼會設定 RequestConfiguration 物件,指定傳回的廣告內容所對應的數位內容標籤分級不得高於 G

final RequestConfiguration requestConfiguration = RequestConfiguration(
  maxAdContentRating: MaxAdContentRating.g);
MobileAds.instance.updateRequestConfiguration(requestConfiguration);

廣告請求

AdManagerAdRequest 物件會收集指定目標資訊,並將這些資訊隨廣告請求一併傳送。

自訂指定目標

您可以傳遞自訂鍵/值組合,指定 Google Ad Manager 廣告活動 (委刊項):

// Example: Pass custom targeting "age=25".
AdManagerAdRequest newRequest = AdManagerAdRequest(
  customTargeting: {'age': '25'},
);

發布商提供的 ID

您可以設定發布商提供的 ID (PPID),用於展示頻率上限、目標對象區隔和指定目標、廣告依序輪播,以及其他以目標對象為準的跨裝置廣告放送控制選項。

以下範例說明如何設定 PPID:

AdManagerAdRequest adRequest = AdManagerAdRequest(
  publisherProvidedId: 'AB123456789',
);

內容網址

如要為內容指定廣告和品牌安全提供內容網址,您可以在建立 AdManagerAdRequest 時傳遞 contentUrl

AdManagerAdRequest request = AdManagerAdRequest(
  contentUrl: 'https://www.example.com',
);

品牌安全

如果應用程式會依目標對象顯示動態內容,可以在建構 AdManagerAdRequest 時提供 neighboringContentUrls,藉此提供簡短的網址清單:

final neighboringContentUrls = [
  'https://www.mycontenturl1.com',
  'https://www.mycontenturl2.com',
  'https://www.mycontenturl3.com',
  'https://www.mycontenturl4.com',
];
AdManagerAdRequest request = AdManagerAdRequest(
    neighboringContentUrls: neighboringContentUrls,
  );

neighboringContentUrlscontentUrl 的不同之處在於,前者僅用於評估品牌安全。