Để thảo luận và đưa ra ý kiến phản hồi về các sản phẩm của chúng tôi, hãy tham gia kênh Discord chính thức của AdMob trong máy chủ Cộng đồng quảng cáo và đo lường của Google.
Hướng dẫn này trình bày các bước mà bạn cần thực hiện để hỗ trợ triển khai thông báo theo quy định của các tiểu bang ở Hoa Kỳ trong SDK UMP. Kết hợp các hướng dẫn này với bài viết Bắt đầu, trong đó trình bày chi tiết cách chạy ứng dụng bằng SDK UMP và thiết lập thông báo. Hướng dẫn sau đây dành riêng cho thông báo theo quy định của các tiểu bang ở Hoa Kỳ.
Điều kiện tiên quyết
Trước khi tiếp tục, hãy đảm bảo bạn đã thực hiện những việc sau:
Cập nhật lên phiên bản mới nhất của UMP SDK.
Để hỗ trợ thông báo theo quy định của các tiểu bang ở Hoa Kỳ, bạn nên sử dụng phiên bản 2.1.0 trở lên.
Hoàn thành các bước trong phần Bắt đầu sử dụng.
Hãy nhớ triển khai một điểm truy cập các lựa chọn về quyền riêng tư và hiển thị điểm truy cập đó nếu cần. Khi hoàn tất hướng dẫn này, bạn sẽ có một điểm truy cập để phân phát thông báo theo quy định của các tiểu bang tại Hoa Kỳ cho người dùng.
Nếu bạn đang sử dụng thông báo theo quy định của các tiểu bang ở Hoa Kỳ cùng với các thông báo khác, hãy tham khảo Các loại thông báo cho người dùng hiện có để biết thời điểm các thông báo khác nhau được hiển thị cho người dùng.
Đặt thẻ cho người dùng dưới độ tuổi hợp pháp
Để cho biết liệu người dùng có chưa đủ tuổi thành niên hay không, hãy đặt
tagForUnderAgeOfConsent (TFUA). Khi bạn đặt TFUA thành true, UMP SDK sẽ không yêu cầu người dùng đồng ý. Nếu ứng dụng của bạn nhắm đến nhiều kiểu đối tượng, hãy đặt tham số này cho người dùng là trẻ em để đảm bảo không yêu cầu họ đồng ý.
Bạn có trách nhiệm đặt tham số này khi cần thiết để tuân thủ COPPA và các quy định có liên quan khác.
Ví dụ sau đây đặt TFUA thành true trong yêu cầu đồng ý của UMP:
Swift
// Create a UMPRequestParameters object.letparameters=RequestParameters()// Indicate the user is under age of consent.parameters.isTaggedForUnderAgeOfConsent=true// Request an update for the consent information.ConsentInformation.shared.requestConsentInfoUpdate(with:parameters){[weakself]requestConsentErroringuardletselfelse{return}// ...}
Objective-C
// Create a UMPRequestParameters object.UMPRequestParameters*parameters=[[UMPRequestParametersalloc]init];// Indicate the user is under age of consent.parameters.tagForUnderAgeOfConsent=YES;// Request an update for the consent information.[UMPConsentInformation.sharedInstancerequestConsentInfoUpdateWithParameters:parameterscompletionHandler:^(NSError*_NullablerequestConsentError){// ...}];
Đọc lựa chọn đồng ý
Sau khi người dùng đưa ra quyết định theo quy định của các tiểu bang tại Hoa Kỳ, bạn có thể đọc lựa chọn của họ từ bộ nhớ cục bộ theo quy cách của Nền tảng quyền riêng tư trên toàn cầu (GPP). Để biết thêm thông tin chi tiết, hãy xem Thông tin chi tiết trong ứng dụng.
Xin lưu ý rằng UMP SDK chỉ điền sẵn các khoá IABGPP_GppSID và IABGPP_HDR_GppString.
Thử nghiệm thông báo theo quy định của các tiểu bang tại Hoa Kỳ
Để thử nghiệm thông báo theo quy định của các tiểu bang ở Hoa Kỳ, hãy sử dụng UMPDebugGeographyRegulatedUSStatedebugGeography để buộc UMP SDK coi thiết bị thử nghiệm của bạn như thể thiết bị đó ở một tiểu bang được quản lý ở Hoa Kỳ. Bạn cũng có thể dùng UMPDebugGeographyOther để buộc chặn thông báo theo quy định của các tiểu bang tại Hoa Kỳ. Để biết thêm thông tin về debugGeography, hãy xem phần Chỉ định một vị trí địa lý.
[null,null,["Cập nhật lần gần đây nhất: 2025-09-02 UTC."],[[["\u003cp\u003eThis guide explains how to integrate the US states regulations message into your iOS app using the User Messaging Platform (UMP) SDK.\u003c/p\u003e\n"],["\u003cp\u003eBefore starting, update to the latest UMP SDK, complete the Get Started guide, create a US states regulations message, and review available message types for potential interactions.\u003c/p\u003e\n"],["\u003cp\u003eUse the \u003ccode\u003etagForUnderAgeOfConsent\u003c/code\u003e parameter to indicate users under the age of consent and ensure compliance with COPPA and other regulations.\u003c/p\u003e\n"],["\u003cp\u003eAccess user consent choices after they interact with the message by reading from local storage according to the Global Privacy Platform (GPP) specifications.\u003c/p\u003e\n"],["\u003cp\u003eTest your implementation using the \u003ccode\u003edebugGeography\u003c/code\u003e setting in the UMP SDK to simulate being in a regulated US state or to suppress the messages.\u003c/p\u003e\n"]]],["To support US states regulations, update to UMP SDK 2.1.0+ and complete the \"Get Started\" guide. Create a US states regulations message, and implement a privacy options entry point. For users under the age of consent, set `tagForUnderAgeOfConsent` to `true` in `UMPRequestParameters`, noting that this tag needs to be set on ad requests as well. After a user's decision, read their choice via the Global Privacy Platform spec. Test using `UMPDebugGeographyRegulatedUSState` (v2.7.0+) to simulate a regulated US state.\n"],null,["Select platform: [Android](/admob/android/privacy/us-iab-support \"View this page for the Android platform docs.\") [iOS](/admob/ios/privacy/us-iab-support \"View this page for the iOS platform docs.\") [Unity](/admob/unity/privacy/us-iab-support \"View this page for the Unity platform docs.\")\n\n\u003cbr /\u003e\n\nThis guide outlines the steps required to support the US states regulations\nmessage as part of the UMP SDK. Pair these instructions with\n[Get started](/admob/ios/privacy), which details how to get your app running\nwith the UMP SDK and set up your message. The following guidance is specific to\nthe US states regulations message.\n\nPrerequisites\n\nBefore continuing, ensure you do the following:\n\n- Update to the latest version of the UMP SDK. For US states regulations messaging support, we recommend you to use version 2.1.0 or higher.\n- Complete [Get started](/admob/ios/privacy). Be sure to implement a privacy options entrypoint and render it if required. By completing this guide, you have an entrypoint to serve your US states regulations message to your users.\n- [Create a US states regulations message](//support.google.com/admob/answer/10860309) for apps.\n- If you're using the US states regulations message alongside other messages, consult [Available user message types](//support.google.com/admob/answer/10114020) to understand when different messages are displayed to your users.\n\nSet the tag for under age of consent\n\nTo indicate whether a user is under the age of consent, set\n`\n`[tagForUnderAgeOfConsent](/admob/ios/privacy/api/reference/Classes/UMPRequestParameters#tagforunderageofconsent) (TFUA). When you set TFUA to `true`, the UMP SDK\ndoesn't request consent from the user. If your app has a mixed audience, set\nthis parameter for child users to ensure consent is not requested.\nIt is your\nresponsibility for setting this parameter where necessary to comply with COPPA\nand other relevant regulations.\n| **Important:** The UMP SDK does not forward the TFUA tag set on consent requests to the Google Mobile Ads SDK. You must explicitly set the `tagForUnderAgeOfConsent` or `tagForChildDirectectedTreatment` on ad requests. If you don't set the `tagForUnderAgeOfConsent` or `tagForChildDirectectedTreatment` on ad requests, the UMP SDK does not collect any information that allows Google to determine whether or not users under the age of consent use your app. For more information about data processing restrictions for these users, see [Tag an ad request from an app for child-directed treatment](//support.google.com/admob/answer/6219315).\n\nThe following example sets TFUA to true on a UMP consent request: \n\nSwift \n\n // Create a UMPRequestParameters object.\n let parameters = RequestParameters()\n // Indicate the user is under age of consent.\n parameters.isTaggedForUnderAgeOfConsent = true\n\n // Request an update for the consent information.\n ConsentInformation.shared.requestConsentInfoUpdate(with: parameters) {\n [weak self] requestConsentError in\n guard let self else { return }\n\n // ...\n }\n\nObjective-C \n\n // Create a UMPRequestParameters object.\n UMPRequestParameters \\*parameters = \\[\\[UMPRequestParameters alloc\\] init\\];\n // Indicate the user is under age of consent.\n parameters.tagForUnderAgeOfConsent = YES;\n\n // Request an update for the consent information.\n [UMPConsentInformation.sharedInstance\n requestConsentInfoUpdateWithParameters:parameters\n completionHandler:^(NSError *_Nullable requestConsentError) {\n // ...\n }];\n\nRead consent choices\n\nAfter the user has made a US states regulations decision, you can read\ntheir choice from local storage following the Global Privacy Platform (GPP)\nspec. For more details see,\n[In-App Details](https://github.com/InteractiveAdvertisingBureau/Global-Privacy-Platform/blob/main/Core/CMP%20API%20Specification.md#in-app-details).\nNote that the UMP SDK only populates the `IABGPP_GppSID` and\n`IABGPP_HDR_GppString` keys.\n\nTest your US states regulations messaging\n\nTo test your US states regulations messaging, use the\n`UMPDebugGeographyRegulatedUSState` `debugGeography` to force the UMP\nSDK to treat your test device as if the device were located in a regulated US\nstate. You can also use `UMPDebugGeographyOther` to force suppression of US\nstates regulations messages. For more details on `debugGeography`, see\n[Force a geography](/admob/ios/privacy#force_a_geography).\n| **Note:** `UMPDebugGeographyRegulatedUSState` is only available in UMP version 2.7.0 or higher."]]