Targeting
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
RequestConfiguration
对象会收集每个广告请求的全局配置,并由 MobileAds.instance.updateRequestConfiguration()
应用。
为确保所有广告请求都应用请求配置更改,请在初始化移动广告 SDK 之前更新请求配置。
面向儿童的设置
为了遵守《儿童在线隐私保护法》(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()
设置标记:
不应将用于启用面向儿童的设置的标记和 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);
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-31。"],[[["\u003cp\u003eThis resource represents AdMob ad units and does not store persistent data.\u003c/p\u003e\n"],["\u003cp\u003eThe primary method available is to list ad units associated with a specific AdMob account.\u003c/p\u003e\n"]]],["The `RequestConfiguration` object, updated via `MobileAds.instance.updateRequestConfiguration()`, manages global ad request settings. Key actions include: setting `tagForChildDirectedTreatment` to `yes`, `no`, or `unspecified` for COPPA compliance; using `tagForUnderAgeOfConsent` to manage GDPR compliance; setting it to `yes`, `no`, or `unspecified`; and utilizing `maxAdContentRating` to filter ad content based on digital content label classifications (G, PG, T, MA). Update it before initializing the Mobile Ads SDK.\n"],null,["Select platform: [Android](/admob/android/targeting \"View this page for the Android platform docs.\") [iOS](/admob/ios/targeting \"View this page for the iOS platform docs.\") [Unity](/admob/unity/targeting \"View this page for the Unity platform docs.\") [Flutter](/admob/flutter/targeting \"View this page for the Flutter platform docs.\")\n\n\u003cbr /\u003e\n\nThe `RequestConfiguration` object collects the global configuration for every ad\nrequest and is applied by `MobileAds.instance.updateRequestConfiguration()`.\n\nTo ensure that all ad requests apply the request configuration changes, update\nthe request configuration before you\n[Initialize the Mobile Ads SDK](/admob/flutter/quick-start#initialize_the_mobile_ads_sdk).\n\nChild-directed setting\n\nFor purposes of the [Children's Online Privacy Protection Act\n(COPPA)](//www.ftc.gov/tips-advice/business-center/privacy-and-security/children%27s-privacy),\nthere is a setting called \"tag for child-directed treatment.\"\n\nAs an app developer, you can indicate whether you want Google to treat your\ncontent as child-directed when you make an ad request. If you indicate that you\nwant Google to treat your content as child-directed, we take steps to disable\nIBA and remarketing ads on that ad request. The setting can be used with all\nversions of the Google Play services SDK through\n`RequestConfiguration.tagForChildDirectedTreatment()`:\n\n- Use the argument `TagForChildDirectedTreatment.yes` to indicate that you want your content treated as child-directed for the purposes of COPPA.\n- Use the argument `TagForChildDirectedTreatment.no` to indicate that you don't want your content treated as child-directed for the purposes of COPPA.\n- Use the argument `TagForChildDirectedTreatment.unspecified` or do not set this tag if you do not wish to indicate how you would like your content treated with respect to COPPA in ad requests.\n\nThe following example indicates that you want your content treated as\nchild-directed for purposes of COPPA: \n\n final RequestConfiguration requestConfiguration = RequestConfiguration(\n tagForChildDirectedTreatment: TagForChildDirectedTreatment.yes);\n MobileAds.instance.updateRequestConfiguration(requestConfiguration);\n\nUsers under the age of consent\n\nYou can mark your ad requests to receive treatment for users in the European\nEconomic Area (EEA) under the age of consent. This feature is designed to help\nfacilitate compliance with the [General Data Protection Regulation\n(GDPR)](//eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:32016R0679).\nNote that you may have other legal obligations under GDPR. Please review the\nEuropean Union's guidance and consult with your own legal counsel. Please\nremember that Google's tools are designed to facilitate compliance and do not\nrelieve any particular publisher of its obligations under the law.\n[Learn more about how the GDPR affects\npublishers](//support.google.com/admob/answer/7666366).\n\nWhen using this feature, a Tag For Users under the Age of Consent in Europe\n(TFUA) parameter will be included in the ad request. This parameter disables\npersonalized advertising, including remarketing, for that specific ad request.\nIt also disables requests to third-party ad vendors, such as ad measurement\npixels and third-party ad servers.\n\nThe tag is set using `RequestConfiguration.tagForUnderAgeOfConsent()`:\n\n- Use the argument `TagForUnderAgeOfConsent.yes` to indicate that you want the request configuration to be handled in a manner suitable for users under the age of consent.\n- Use the argument `TagForUnderAgeOfConsent.no` to indicates that you don't want the request configuration to be handled in a manner suitable for users under the age of consent.\n- Use the argument `TagForUnderAgeOfConsent.unspecified` or do not set this\n tag to indicate that you have not specified whether the ad request should\n receive treatment for users in the European Economic Area (EEA) under the\n age of consent. The following example indicates that you want TFUA included\n in your ad request:\n\n final RequestConfiguration requestConfiguration = RequestConfiguration(\n tagForUnderAgeOfConsent: TagForUnderAgeOfConsent.yes);\n MobileAds.instance.updateRequestConfiguration(requestConfiguration);\n\nThe tags to enable the Child-directed setting and `setTagForUnderAgeOfConsent`\nshould not both simultaneously be set to `true`. If they are, the child-directed\nsetting takes precedence.\n\nAd content filtering\n\nAd content ratings can be set using `RequestConfiguration.maxAdContentRating()`:\n\nAdMob ads returned for these requests have a content rating at or below that\nlevel. The possible values for this network extra are based on [digital content\nlabel classifications](//support.google.com/admob/answer/7562142) and can be one\nof the following `MaxAdContentRating` objects:\n\n- `MaxAdContentRating.g`\n- `MaxAdContentRating.pg`\n- `MaxAdContentRating.t`\n- `MaxAdContentRating.ma`\n\nThe following code configures a `RequestConfiguration` object to specify that\nthe ad content returned correspond to a digital content label designation no\nhigher than `G`: \n\n final RequestConfiguration requestConfiguration = RequestConfiguration(\n maxAdContentRating: MaxAdContentRating.g);\n MobileAds.instance.updateRequestConfiguration(requestConfiguration);"]]