您可以使用 TFUA(以前称为“用于表示用户未达到同意年龄的标记”)标记对广告请求进行标记,以确保针对欧洲经济区 (EEA)、英国和瑞士用户采用“受限的数据处理”模式。这项功能旨在帮助您遵守《一般数据保护条例》(GDPR) 和相关的儿童隐私保护法规,例如《适龄设计规范》(AADC)。需要说明的是,您可能还须承担 GDPR 和 AADC 规定的其他法律义务。具体请查看所有法规指南,并咨询您的法律顾问。另外请注意,Google 的工具旨在协助客户遵守法规,并不能免除任何特定发布商按照法律要求所需承担的义务。不妨详细了解 GDPR 和 AADC 给发布商带来了哪些影响。
使用这项功能时,广告请求中会包含一个 TFUA
参数。此参数会禁止针对该广告请求投放个性化广告,包括再营销广告。它还会禁止向第三方广告供应商(例如广告衡量像素和第三方广告服务器)发送请求。
在广告请求中加入 TFUA
参数后,任何适用的网站级设置若与此冲突,则一概无效。
如果您使用的是 Google 的广告服务,并希望根据《儿童在线隐私保护法》(COPPA) 的规定在网站、子网域或应用一级(而不是根据单个广告请求判断)请求采用“受限的数据处理”模式,请参阅将网站或广告请求标记为面向儿童。
不应将 TFCD 和 TFUA 标记同时设置为 true
。如果同时设置为 true,系统会以 TFCD 标记为准。
JavaScript 代码
如果您的网页使用异步广告代码 (adsbygoogle.js
) 向 AdSense 请求广告(AdSense 内容广告),那么,要请求适合采用“受限的数据处理”模式的广告,您需要在每段广告代码中加入 data-tag-for-under-age-of-consent="1"
参数。例如:
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1234567890123456" crossorigin="anonymous">
</script>
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1234567890123456"
data-ad-slot="0123456789"
data-tag-for-under-age-of-consent="1"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
如果您使用旧版同步广告代码 (show_ads.js
),那么您需要在每段广告代码中设置 google_tag_for_under_age_of_consent=1
变量。例如:
<script>
google_ad_client = "ca-pub-1234567890123456";
google_ad_slot = "0123456789";
google_ad_width = 125;
google_ad_height = 125;
google_tag_for_under_age_of_consent = 1;
</script>
<script src="https://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<amp-ad>
代码
<amp-ad type="adsense">
支持通过 amp-consent
组件将请求标记为采用“受限的数据处理”模式。发布商可以利用该组件指明 checkConsentHref
端点,对于指定了 data-block-on-consent
属性的页面,系统会先查询该端点,然后该页面中的任何组件才会发出请求。不妨详细了解 amp-consent
和 ConsentHref
响应的格式
如果发布商的 ConsentHref
端点返回了键“tfua
”或“tfcd
”,那么后续的 AdSense 请求就会分别被标记为采用“受限的数据处理”模式。例如,下面这个 AMP 网页包含一个意见征求组件和一个广告:
<amp-consent layout="nodisplay" id="consent-element">
<script type="application/json">
{
"consents": {
"my-consent": {
"checkConsentHref": "https://publisher.com/api/check-consent",
"promptUI": "consent-ui"
}
}
}
</script>
</amp-consent>
<amp-ad data-block-on-consent
width=320 height=50
type="adsense"
data-slot="/4119129/mobile_ad_banner"
json='{"targeting":{"sport":["rugby","cricket"]},
"categoryExclusions":["health"]}'>
</amp-ad>
来自发布商 ConsentHref
(https://publisher.com/api/check-consent
) 的以下响应将为该 AdSense 广告请求启用“受限的数据处理”模式:
{
"promptIfUnknown": false,
"sharedData": {
"adsense-tfua": 1,
"adsense-tfcd": 0
}
}
也可以按如下所示使用定位用的 JSON 对象在 <amp-ad>
代码中以静态方式设置 TFUA
和 TFCD
,例如:
<amp-ad data-block-on-consent
width=320 height=50
type="adsense"
data-slot="/4119129/mobile_ad_banner"
json='{"targeting":{"sport":["rugby","cricket"]},
"categoryExclusions":["health"],
"tagForChildDirectedTreatment":1,
"tagForUnderAgeTreatment":1}'>
</amp-ad>
最后请注意,为了帮助您遵守这些规定,您也可以为向第三方发出请求的其他 AMP 组件(例如 amp-analytics
和 amp-pixel
)设置 data-block-on-consent
。