Targeting

本指南介绍如何向广告请求提供定位信息。

准备工作

在继续操作之前,请设置 Google Mobile Ads Unity Plugin。

请求配置

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

MobileAds.SetRequestConfiguration(requestConfiguration);

为确保所有广告请求都应用请求配置更改,请在初始化 SDK 之前设置请求配置。

设置年龄处理方式

为帮助您遵守面向儿童和青少年的适用隐私权法规,Google Mobile Ads Unity Plugin 提供了一项年龄处理方式设置。通过年龄分级保护方式设置,您可以指明 Google Mobile Ads Unity Plugin 是否应采用面向儿童、青少年或年龄不明用户的特定广告投放保护措施。

您可以通过 RequestConfiguration 对象中的 AgeRestrictedTreatment 属性设置年龄处理方式。

以下示例展示了如何指明广告请求应按针对儿童的年龄处理方式进行处理:

RequestConfiguration requestConfiguration = new RequestConfiguration
{
    // Indicate that ad requests should have child age treatment.
    AgeRestrictedTreatment = AgeRestrictedTreatment.Child
};
MobileAds.SetRequestConfiguration(requestConfiguration);

如需指明面向青少年或年龄不明用户的年龄处理方式,请将 AgeRestrictedTreatment.Child 设置替换为以下内容:

  • AgeRestrictedTreatment.Teen
  • AgeRestrictedTreatment.Unspecified

使用此设置时,Google Mobile Ads Unity Plugin 会在广告请求中包含 tfat 参数。请咨询法律顾问,依据自身的法律及监管义务,为用户确定适用的年龄处理方式。如需了解详情,请参阅将应用发出的广告请求标记为受年龄限制的处理。

从 TFCD 和 TFUA 迁移到年龄处理方式设置

年龄处理方式设置取代了已弃用的 TagForChildDirectedTreatment (TFCD) 和 TagForUnderAgeOfConsent (TFUA) 属性。

下表列出了 TFCD 和 TFUA 相关设置及对等的年龄分级保护方式:

TFCD

TFCD 年龄处理方式
TagForChildDirectedTreatment.True AgeRestrictedTreatment.Child
TagForChildDirectedTreatment.False AgeRestrictedTreatment.Unspecified
TagForChildDirectedTreatment.Unspecified AgeRestrictedTreatment.Unspecified
未指定价值 AgeRestrictedTreatment.Unspecified
无对等处理方式 AgeRestrictedTreatment.Teen

TFUA

TFUA 年龄处理方式
TagForUnderAgeOfConsent.True AgeRestrictedTreatment.Child
TagForUnderAgeOfConsent.False AgeRestrictedTreatment.Unspecified
TagForUnderAgeOfConsent.Unspecified AgeRestrictedTreatment.Unspecified
未指定价值 AgeRestrictedTreatment.Unspecified
无对等处理方式 AgeRestrictedTreatment.Teen

了解年龄处理方式与 TFCD 和 TFUA 的相互作用

如果您同时设置了年龄处理方式和 TFCD/TFUA,Google 会采用最保守的处理方式。

通过 AdMob 中介转发年龄处理信号

如果您使用 Google Mobile Ads Unity Plugin设置年龄处理方式,中介适配器会将年龄处理信号转发到集成的第三方广告来源。

下表列出了支持将受年龄限制的处理信号转发到集成的第三方广告来源的中介适配器版本:

中介适配器名称 支持的最低版本
AppLovin 8.7.4
BidMachine 1.4.2
Bigo 1.1.0
Chartboost 4.13.0
DTExchange (Fyber) 3.5.10
i-mobile 1.3.13
InMobi 5.3.0
IronSource 4.5.3
Liftoff Monetize (Vungle) 5.7.5
LY (Line) 2.1.1
maio 3.1.9
Meta (Facebook) 3.18.7
Mintegral 2.2.3
Moloco 3.8.0
MyTarget 3.39.0
Pangle 7.0.0
PubMatic 2.1.3

面向儿童的设置

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

作为应用开发者,您可以在发出广告请求时表明是否希望 Google 将您的内容视为面向儿童的内容。如果您表明希望 Google 将您的内容视为面向儿童的内容,Google Mobile Ads Unity Plugin会采取相应措施,在该广告请求上停用针对用户兴趣投放广告和再营销广告。对于所有版本的 Google Play 服务 SDK,请通过 RequestConfiguration.TagForChildDirectedTreatment 使用此设置:

  • 在 RequestConfiguration 中调用 TagForChildDirectedTreatment 并传入参数 TagForChildDirectedTreatment.True,即表明您希望根据 COPPA 的规定将您的内容视为面向儿童的内容。
  • 在 RequestConfiguration 中调用 TagForChildDirectedTreatment 并传入参数 TagForChildDirectedTreatment.False,即表明您不希望根据 COPPA 的规定将您的内容视为面向儿童的内容。
  • 如果您不希望在广告请求中表明您想如何根据 COPPA 的规定来认定您的内容,请不要调用 TagForChildDirectedTreatment。

以下示例表明您希望根据《儿童在线隐私保护法》(COPPA) 的规定将您的内容视为面向儿童的内容:

RequestConfiguration requestConfiguration = new RequestConfiguration
{
    TagForChildDirectedTreatment = TagForChildDirectedTreatment.True
};
MobileAds.SetRequestConfiguration(requestConfiguration);

您可以对广告请求进行标记,确保针对欧洲经济区 (EEA) 未达到同意年龄的用户进行适当处理。这项功能旨在帮助您遵守《一般数据保护条例》(GDPR)。您可能还须承担 GDPR 规定的其他法律义务。具体请查看欧盟发布的指导原则,并咨询您的法律顾问。Google 的工具旨在协助您遵守相关法规,但并不能免除任何特定发布商按照法律要求所需承担的义务。

详细了解 GDPR 给发布商带来了哪些影响。

使用这项功能时,广告请求中会包含一个用于表示用户位于欧洲且未达到同意年龄的标记 (TFUA) 参数。此参数会禁止针对该特定广告请求投放个性化广告,包括再营销广告。它还禁止向第三方广告供应商(例如广告效果衡量像素和第三方广告服务器)发送请求。

通过使用 RequestConfiguration.TagForUnderAgeOfConsent,该设置可用于所有版本的 Google Play 服务 SDK:

  • 在 RequestConfiguration 中调用 TagForUnderAgeOfConsent 并传入参数 TagForUnderAgeOfConsent.True,即表明您希望按适合未达到同意年龄的用户的方式处理该请求配置。
  • 在 RequestConfiguration 中调用 TagForUnderAgeOfConsent 并传入参数 TagForUnderAgeOfConsent.False,即表明您不希望按适合未达到同意年龄的用户的方式处理该请求配置。

以下示例表明您希望广告请求中包含 TFUA 标记:

RequestConfiguration requestConfiguration = new RequestConfiguration
{
    TagForUnderAgeOfConsent = TagForUnderAgeOfConsent.True
};
MobileAds.SetRequestConfiguration(requestConfiguration);

不应将用于启用面向儿童的内容设置的标记和 TagForUnderAgeOfConsent 同时设置为 true。如果同时设置为 true,则以“面向儿童的设置”为准。

广告内容过滤

通过使用 RequestConfiguration.Builder.SetMaxAdContentRating(),该设置可用于所有版本的 Google Play 服务 SDK:

应用可以通过在 RequestConfiguration 上调用 MaxAdContentRating,为其请求配置设置广告内容分级上限。对于这些请求,所返回的 AdMob 广告的内容分级会等于或低于该上限。此广告联盟额外信息可能的值依数字内容标签分类而定,并应该是以下 MaxAdContentRating 对象之一:

  • MaxAdContentRating.G
  • MaxAdContentRating.PG
  • MaxAdContentRating.T
  • MaxAdContentRating.MA

下面的代码会配置 RequestConfiguration 对象,以指定返回的广告内容所对应的数字内容标签不应高于 G:

RequestConfiguration requestConfiguration = new RequestConfiguration
{
    MaxAdContentRating = MaxAdContentRating.G
};
MobileAds.SetRequestConfiguration(requestConfiguration);

广告请求

AdRequest 对象会收集随广告请求一起发送的定位信息。

添加广告联盟额外信息

广告联盟额外信息是指随广告请求一起发送的额外详细信息,这些信息仅与一个广告来源相关。

以下代码段为 Google 设置了一个额外的参数键 collapsible(值为 bottom):

var adRequest = new AdRequest();
adRequest.Extras.Add("collapsible", "bottom");