On this page
- Tag for age treatment (TFAT)
- About age treatment settings
- Tag a request with JavaScript tags
- Tag a request with
<amp-ad>tags
Tag for age treatment (TFAT)
The age treatment setting is a tool to help you manage your compliance with the General Data Protection Regulation (GDPR) , the Children’s Online Privacy Protection Act (COPPA) the Age Appropriate Design Code (AADC), and the Australia Online Safety Act (AU OSA), or other applicable laws or regulations.
Learn more about how the GDPR and AADC affect publishers .
Please remember that Google's tools do not relieve you of your obligations under the law. Consult your legal counsel to determine the age treatment settings for your users based on your legal and regulatory requirements.
About age treatment settings
The following settings let you specify how the Google handles ad requests for different age treatments:
- CHILD :Indicates that ad requests should receive child age treatment. Child age treatment is specified by the value 1. This results in specific ad request behaviors, such as:
- Personalized ads and remarketing are disabled.
- Requests to third-party ad vendors, such as ad measurement pixels and third-party ad servers, are disabled.
- Ad-serving protections for children are applied.
- TEEN :Indicates that ad requests should receive teen age treatment. Teen age treatment is specified by the value 2. This results in specific ad request behaviors, such as:
- Personalized ads and remarketing are disabled.
- Ad-serving protections for teens are applied.
- UNSPECIFIED :Indicates that no specific age treatment has been set for ad requests. This is the default state and specified by the value 0.
Learn more about TFAT and COPPA
If you set the age treatment setting and the TFCD or TFUA settings, Google applies the most conservative treatment.
Tag a request with JavaScript tags
If you're using asynchronous or older synchronous ad code refer to these examples.
Examples of asynchronous ad code (adsbygoogle.js)
If your page uses the asynchronous ad code ( adsbygoogle.js
) to request ads from AdSense (AFC), request ads suited for restricted data processing by including the parameter data-tag-for-age-treatment
in every tag.
Example for child treatment
<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-age-treatment="1"
></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
Example for teen treatment
<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-age-treatment="2"
></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
Example for no specific age treatment
<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-age-treatment="0"
></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
Examples of older synchronous ad code (show_ads.js)
If you use the older synchronous ad tag ( show_ads.js
), then set the variable google_tag_for_age_treatment
in every ad tag.
Example for child treatment
<script>
google_ad_client = "ca-pub-1234567890123456";
google_ad_slot = "0123456789";
google_ad_width = 125;
google_ad_height = 125; google_tag_for_age_treatment = 1
;
</script>
<script src="https://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
Example for teen treatment
<script>
google_ad_client = "ca-pub-1234567890123456";
google_ad_slot = "0123456789";
google_ad_width = 125;
google_ad_height = 125; google_tag_for_age_treatment = 2
;
</script>
<script src="https://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
Example for no specific age treatment
<script>
google_ad_client = "ca-pub-1234567890123456";
google_ad_slot = "0123456789";
google_ad_width = 125;
google_ad_height = 125; google_tag_for_age_treatment = 0
;
</script>
<script src="https://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
Tag a request with <amp-ad>
tags
To help you manage your compliance with global privacy regulations like GDPR/AADC (using the TFUA tag for EEA, UK, and Switzerland) and COPPA (using the TFCD
tag for child-directed content), you can mark your ad requests for restricted data processing. Please remember that Google's tools do not relieve you of your obligations under the law. Consult your legal counsel to determine the age treatment settings for your users based on your legal and regulatory requirements.
<amp-ad type="adsense">
supports marking requests for restricted data processing via the amp-consent
component. That component allows the publisher to specify checkConsentHref
, an endpoint that is queried before requests are sent from any component on the page that specifies the attribute data-block-on-consent
. Read more about amp-consent
and the format of ConsentHref
responses
.
If the publisher’s ConsentHref
endpoint returns the " tfua
" or " tfcd
" key, subsequent AdSense requests are marked for restricted data processing. For example, consider an AMP page with a consent component and an ad:
<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>
The following response from the publisher’s ConsentHref
( https://publisher.com/api/check-consent
) would enable restricted data processing for the AdSense ad request:
{
"promptIfUnknown": false,
"sharedData": {
"adsense-tfua": 1,
"adsense-tfcd": 0
}
}
TFUA
and TFCD
can also be set statically on <amp-ad>
tags using the targeting JSON object as follows, for example:
<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>
Finally, to help you comply with these requirements, note that data-block-on-consent
can also be set for other AMP components that make requests to third parties, such as amp-analytics
and amp-pixel
.

