定位

RequestConfiguration 对象会收集每个广告请求的全局配置,并由 MobileAds.instance.updateRequestConfiguration() 应用。

面向儿童的设置

为了遵守《儿童在线隐私保护法》(COPPA) 的规定,我们提供了一项名为“面向儿童的内容的标记”的设置。

作为应用开发者,您可以在发出广告请求时指明是否希望 Google 将您的内容视为面向儿童的内容。如果您表明希望 Google 将您的内容视为面向儿童的内容,我们会采取措施,针对该广告请求停用针对用户兴趣投放广告和再营销广告。通过 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);

您可以对广告请求进行标记,确保针对未达到同意年龄的欧洲经济区 (EEA) 用户投放的是合适的广告。这项功能旨在帮助您遵守一般数据保护条例 (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。如果同时设置为 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'},
);

发布商提供的标识符 (PPID)

您可以设置发布商提供的标识符 (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 的区别在于,前者仅用于品牌保障。