指定目標
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
RequestConfiguration
物件會收集每個廣告請求的全域設定,並由 MobileAds.instance.updateRequestConfiguration()
套用。
為確保所有廣告請求都套用相關設定變更,請先更新請求設定,再初始化 Mobile Ads SDK。
兒童導向內容設定
根據兒童網路隱私保護法 (COPPA),系統提供「兒童導向內容標記」設定。
應用程式開發人員可以在傳送廣告請求時,指明是否希望 Google 將內容標為兒童導向。如果選擇將內容視為兒童導向,Google 就會採取必要措施,停用該廣告請求的 IBA 和再行銷廣告。這項設定適用於透過 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);
未滿規定年齡的使用者
針對未滿規定年齡的歐洲經濟區使用者,您可以在廣告請求中加上相關處理標記。這項功能的立意是協助發布商遵守《一般資料保護規則》(GDPR)。請注意,您可能還有 GDPR 所衍生的其他法律義務。請查看歐盟發布的指南並諮詢您的法律顧問。提醒您,Google 提供工具的用意是協助發布商遵守規定,而非方便發布商規避法定義務。進一步瞭解 GDPR 對發布商的影響。
使用這項功能時,廣告請求會包含歐洲使用者適用的「未滿規定年齡標記」(TFUA) 參數。這個參數會針對特定廣告請求,停用個人化廣告功能 (包括再行銷)。並停止向第三方廣告供應商 (例如廣告評估像素和第三方廣告伺服器) 提出其他請求。
使用 RequestConfiguration.tagForUnderAgeOfConsent()
設定代碼:
用於啟用兒童導向內容設定和 setTagForUnderAgeOfConsent
的標記,不可同時設為 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);
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-09-06 (世界標準時間)。
[[["容易理解","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"]],["上次更新時間:2025-09-06 (世界標準時間)。"],[[["\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);"]]