[[["容易理解","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-08-27 (世界標準時間)。"],[[["\u003cp\u003eThis guide explains how to provide targeting information to an ad request using \u003ccode\u003eGADRequestConfiguration\u003c/code\u003e and \u003ccode\u003eGADRequest\u003c/code\u003e objects in your iOS app.\u003c/p\u003e\n"],["\u003cp\u003eYou can configure ad requests to indicate child-directed treatment for COPPA compliance, or treatment for users under the age of consent (TFUA) for GDPR compliance.\u003c/p\u003e\n"],["\u003cp\u003eAd content filtering can be applied using \u003ccode\u003emaxAdContentRating\u003c/code\u003e to specify the maximum allowed content rating for ads.\u003c/p\u003e\n"],["\u003cp\u003ePublisher Privacy Treatment (Beta) enables apps to control ad personalization by setting \u003ccode\u003epublisherPrivacyPersonalizationState\u003c/code\u003e to disabled.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGADRequest\u003c/code\u003e allows passing the content URL for keyword targeting, enabling more relevant ads to be served.\u003c/p\u003e\n"]]],["Ad targeting involves configuring `GADRequestConfiguration` to apply settings globally. Key actions include setting `tagForChildDirectedTreatment` for COPPA compliance and `tagForUnderAgeOfConsent` for GDPR, both disabling personalized ads and IDFA transmission. The `maxAdContentRating` property filters ad content, while `publisherPrivacyPersonalizationState` turns off ad personalization. Apps can also specify the content URL for keyword targeting within `GADRequest`. On refresh, `GADRequest` object targeting is reused.\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\nThis guide explains how to provide targeting information to an ad request.\n\nTo see ad targeting in action, download the iOS API Demo app in Swift or\nObjective-C.\n\n[Download API Demo](//github.com/googleads/googleads-mobile-ios-examples/releases/latest)\n\nPrerequisites\n\nComplete the [Get Started](/admob/ios/quick-start) guide.\n\nGADRequestConfiguration\n\n[`GADRequestConfiguration`](/admob/ios/api/reference/Classes/GADRequestConfiguration)\nis an object that collects targeting information to be applied globally through\nthe\n[`GADMobileAds`](/admob/ios/api/reference/Classes/GADMobileAds#requestconfiguration)\nshared instance. It can be accessed with the following code: \n\nSwift \n\n let requestConfiguration = MobileAds.shared.requestConfiguration\n\nObjective-C \n\n GADRequestConfiguration requestConfiguration = GADMobileAds.sharedInstance.requestConfiguration;\n\nTo ensure that all ad requests apply the request configuration changes, set\nthe request configuration before you\n[Initialize Google Mobile Ads SDK](/admob/ios/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/business-guidance/privacy-security/childrens-privacy),\nthere is a setting called\n[`tagForChildDirectedTreatment`](/admob/ios/api/reference/Classes/GADRequestConfiguration#tagforchilddirectedtreatment).\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. When you indicate that\nyou want Google to treat your content as child-directed, Google takes steps\nto disable IBA and remarketing ads on that ad request. The setting options are\nas follows:\n\n- Set `tagForChildDirectedTreatment` to `true` to indicate that you want your content treated as child-directed for purposes of COPPA. This prevents the transmission of the Advertising Identifier, IDFA.\n- Set `tagForChildDirectedTreatment` to `false` to indicate that you don't want your content treated as child-directed for purposes of COPPA.\n- Don't set `tagForChildDirectedTreatment` if you don't want to indicate how you would like your content treated with respect to COPPA.\n\nThe following example indicates that you want your content to be treated as\nchild-directed for purposes of COPPA: \n\nSwift \n\n MobileAds.shared.requestConfiguration.tagForChildDirectedTreatment = true\n\nObjective-C \n\n GADMobileAds.sharedInstance.requestConfiguration.tagForChildDirectedTreatment = @YES;\n\nBy setting this tag, you certify that this notification is accurate and you are\nauthorized to act on behalf of the owner of the app. You understand that abuse\nof this setting may result in termination of your Google Account.\n\nUsers under the age of consent\n\n\nYou can mark your ad requests to receive treatment for users in the\nEuropean Economic Area (EEA) under the age of consent. This feature is\ndesigned to help facilitate compliance with the [General\nData Protection Regulation (GDPR)](//eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:32016R0679). Note that you may have other legal\nobligations under GDPR. Review European Union guidance and consult with\nyour own legal counsel. Note that Google's tools are designed to facilitate\ncompliance and don't relieve any particular publisher of its obligations under\nthe law.\n\n\n[Learn more about how the GDPR affects\npublishers](//support.google.com/admob/answer/7666366).\n\n\nWhen using this feature, a Tag For Users under the Age of Consent in\nEurope (TFUA) parameter will be included in all future ad requests.\nThis parameter disables personalized advertising, including remarketing, for\nthat specific ad request. It also disables requests to third-party ad vendors,\nsuch as ad measurement pixels and third-party ad servers.\n\nThe setting can be used with all versions of Google Mobile Ads SDK by\nsetting the\n[`tagForUnderAgeOfConsent`](/admob/ios/api/reference/Classes/GADRequestConfiguration#tagforunderageofconsent) property on the\n`GADMobileAds.requestConfiguration` object and passing in `true`.\n\n- Set `tagForUnderAgeOfConsent` to `true` to indicate that you want ad requests to be handled in a manner suitable for users under the age of consent. This also prevents the transmission of the Advertising Identifier, IDFA.\n- Not setting `tagForUnderAgeOfConsent` indicates that you don't want ad requests to be handled in a manner suitable for users under the age of consent.\n\nThe following example indicates that you want TFUA included in your ad request: \n\nSwift \n\n MobileAds.shared.requestConfiguration.tagForUnderAgeOfConsent = true\n\nObjective-C \n\n GADMobileAds.sharedInstance.requestConfiguration.tagForUnderAgeOfConsent = @YES;\n\nThe tags to enable the [child-directed setting](#child-directed_setting)\nand `tagForUnderAgeOfConsent` shouldn't both simultaneously be set to `true`.\nIf they are, the child-directed setting takes precedence.\n| **Key Point:** This `tagForUnderAgeOfConsent` parameter is *not* forwarded to mediation adapters for third-party ad sources. It's your responsibility to ensure that each third-party ad network in your app serves ads that are appropriate for users under the age of consent per GDPR.\n\nAd content filtering\n\nApps can set a maximum ad content rating for all ad requests using the\n`maxAdContentRating` property of `GADRequestConfiguration`. This setting applies\nto all future ad requests for the remainder of the session. The possible values\nfor this property are based on [digital content label\nclassifications](//support.google.com/admob/answer/7562142), and should be one\nof the following constants:\n\n- `GADMaxAdContentRatingGeneral`\n- `GADMaxAdContentRatingParentalGuidance`\n- `GADMaxAdContentRatingTeen`\n- `GADMaxAdContentRatingMatureAudience`\n\nThe following code configures all ad requests to specify that ad content\nreturned should correspond to a Digital Content Label designation no higher than\n`GADMaxAdContentRatingGeneral`.\n**Key Point:** Content rating filter settings specified through the SDK override any settings configured using the AdMob UI. \n\nSwift \n\n MobileAds.shared.requestConfiguration.maxAdContentRating =\n GADMaxAdContentRating.general\n\nObjective-C \n\n GADMobileAds.sharedInstance.requestConfiguration.maxAdContentRating =\n GADMaxAdContentRatingGeneral;\n\nPublisher Privacy Treatment (Beta)\n\nThe\n\n[Publisher Privacy Treatment](//support.google.com/admob/answer/14323214)\n\n(PPT) API is an optional tool that lets apps indicate whether to turn off ads\npersonalization for all ad requests using the\n[`publisherPrivacyPersonalizationState`](/admob/ios/api/reference/Classes/GADRequestConfiguration#publisherprivacypersonalizationstate)\nproperty of `GADRequestConfiguration`. When using this feature, a publisher\nprivacy treatment (PPT) parameter is included in all future ad requests for the\nremainder of the session.\n\nBy default, ad requests to Google are served personalized ads. The following\ncode turns off ads personalization for all ad requests: \n\nSwift \n\n MobileAds.shared.requestConfiguration.publisherPrivacyPersonalizationState =\n .disabled\n\nObjective-C \n\n GADMobileAds.sharedInstance.requestConfiguration.publisherPrivacyPersonalizationState =\n GADPublisherPrivacyPersonalizationStateDisabled;\n\n| **Note:** For ad requests with multiple user privacy signals, the most restrictive signal will take precedence. See the [Publisher Privacy Treatment API](//support.google.com/admob/answer/14323214) documentation for specific examples.\n\nGADRequest\n\nThe `GADRequest` object collects targeting information to be sent with an\nad request.\n\nAdd network extras\n\nNetwork extras are extra details sent with an ad request that are specific to\na single ad source.\n\nThe following code snippet sets an extra parameter key of `collapsible` with\na value of `bottom` to Google: \n\nSwift \n\n let request = Request()\n let extras = Extras()\n extras.additionalParameters = [\"collapsible\": \"bottom\"]\n request.register(extras)\n adLoader?.load(request)\n\nObjective-C \n\n GADRequest *request = [GADRequest request];\n GADExtras *extras = [[GADExtras alloc] init];\n extras.additionalParameters = @{@\"collapsible\": @\"bottom\"};\n [request registerAdNetworkExtras:extras];\n [self.adLoader loadRequest:request];\n\nContent URL\n\nWhen requesting an ad, apps can pass the URL of the content they are serving.\nThis enables keyword targeting to match the ad with the content.\n\nFor example, if your app is requesting an ad while showing content from\n`https://www.example.com`, you can pass this URL to target relevant keywords: \n\nSwift \n\n let request = Request()\n request.contentURL = \"https://www.example.com\"\n\nObjective-C \n\n GADRequest *request = [GADRequest request];\n request.contentURL = @\"https://www.example.com\";\n\nFAQ\n\nWhat targeting gets used when an ad automatically refreshes?\n: On ad refresh, the previously specified `GADRequest` object is used for\n targeting again.\n To set new targeting, explicitly call `loadRequest` on `GADBannerView`\n with a new `GADRequest` object.\n\nHow do I pass extra targeting parameters to mediation networks?\n: See [Mediation](/admob/ios/mediation) to find out how to send targeting to\n mediation networks."]]