Aby omawiać nasze usługi i przekazywać opinie na ich temat, dołącz do oficjalnego kanału AdMob na Discordzie na serwerze społeczności Google Ads i pomiarów.
Ten przewodnik zawiera instrukcje, jak w ramach pakietu UMP SDK obsługiwać wiadomości zgodne z amerykańskimi przepisami stanowymi. Skorzystaj z tych instrukcji w połączeniu z artykułem Wprowadzenie, w którym znajdziesz szczegółowe informacje o tym, jak uruchomić aplikację z pakietem UMP SDK i skonfigurować wiadomość. Poniższe wskazówki dotyczą konkretnie wiadomości wymaganej przez amerykańskie przepisy stanowe.
Wymagania wstępne
Zanim przejdziesz dalej, wykonaj te czynności:
Zaktualizuj pakiet SDK UMP do najnowszej wersji.
Aby obsługiwać wiadomości dotyczące przepisów stanowych w Stanach Zjednoczonych, zalecamy korzystanie z wersji
2.1.0
lub nowszej.
Kliknij Rozpocznij.
Pamiętaj, aby zaimplementować punkt wejścia opcji prywatności i w razie potrzeby go renderować. Po przeczytaniu tego przewodnika będziesz mieć punkt wejścia do wyświetlania użytkownikom wiadomości zgodnej z przepisami stanowymi w USA.
Jeśli używasz wiadomości zgodnej z przepisami stanowymi w USA razem z innymi wiadomościami, zapoznaj się z dostępnymi typami wiadomości dla użytkowników, aby dowiedzieć się, kiedy różne wiadomości są wyświetlane użytkownikom.
Ustawianie tagu dotyczącego użytkowników poniżej wieku świadomego wyrażenia zgody
Aby wskazać, czy użytkownik nie osiągnął wieku samodzielnego wyrażania zgody, ustaw parametr
setTagForUnderAgeOfConsent (TFUA). Jeśli ustawisz TFUA na true, pakiet SDK UMP nie będzie prosić użytkownika o zgodę. Jeśli Twoja aplikacja jest przeznaczona dla różnych grup odbiorców, ustaw ten parametr dla użytkowników będących dziećmi, aby mieć pewność, że nie będą oni proszeni o zgodę.
Twoim obowiązkiem jest ustawienie tego parametru w razie potrzeby, aby zachować zgodność z ustawą COPPA i innymi odpowiednimi przepisami.
W tym przykładzie ustawiamy wartość TFUA na „true” w żądaniu zgody UMP:
Java
ConsentRequestParametersparams=newConsentRequestParameters.Builder()// Indicate the user is under age of consent..setTagForUnderAgeOfConsent(true).build();consentInformation=UserMessagingPlatform.getConsentInformation(this);consentInformation.requestConsentInfoUpdate(this,params,(OnConsentInfoUpdateSuccessListener)()->{// ...},(OnConsentInfoUpdateFailureListener)requestConsentError->{// ...});
Kotlin
valparams=ConsentRequestParameters.Builder()// Indicate the user is under age of consent..setTagForUnderAgeOfConsent(true).build()consentInformation=UserMessagingPlatform.getConsentInformation(this)consentInformation.requestConsentInfoUpdate(this,params,ConsentInformation.OnConsentInfoUpdateSuccessListener{// ...},ConsentInformation.OnConsentInfoUpdateFailureListener{requestConsentError->
// ...})
Odczytywanie wyborów użytkownika dotyczących zgody na przetwarzanie danych
Gdy użytkownik podejmie decyzję dotyczącą przepisów stanowych w USA, możesz odczytać jego wybór z pamięci lokalnej zgodnie ze specyfikacją globalnej platformy do zarządzania prywatnością (GPP). Więcej informacji znajdziesz w sekcji Szczegóły w aplikacji.
Pamiętaj, że pakiet SDK UMP wypełnia tylko klucze IABGPP_GppSID i IABGPP_HDR_GppString.
Testowanie wiadomości wymaganych przez amerykańskie przepisy stanowe
Aby przetestować wiadomości wymagane przez przepisy stanów USA, użyj parametru
UMPDebugGeographyRegulatedUSStatedebugGeography, aby wymusić na pakiecie SDK platformy UMP traktowanie urządzenia testowego tak, jakby znajdowało się ono w stanie USA, w którym obowiązują odpowiednie przepisy. Możesz też użyć parametru UMPDebugGeographyOther, aby wymusić pomijanie wiadomości wymaganych przez przepisy stanowe w USA. Więcej informacji o debugGeography znajdziesz w artykule Wymuszanie lokalizacji geograficznej.
[null,null,["Ostatnia aktualizacja: 2025-09-02 UTC."],[[["\u003cp\u003eThis guide provides instructions on integrating the US states regulations message into your Android app using the User Messaging Platform (UMP) SDK.\u003c/p\u003e\n"],["\u003cp\u003eBefore you begin, ensure you have updated to the latest UMP SDK, completed the 'Get started' guide, created a US states regulations message, and reviewed the available user message types.\u003c/p\u003e\n"],["\u003cp\u003eSet the TagForUnderAgeOfConsent (TFUA) parameter to \u003ccode\u003etrue\u003c/code\u003e for users under the age of consent to prevent the UMP SDK from requesting consent, ensuring compliance with regulations like COPPA.\u003c/p\u003e\n"],["\u003cp\u003eYou can read the user's consent choices from local storage following the Global Privacy Platform (GPP) spec after they have interacted with the message.\u003c/p\u003e\n"],["\u003cp\u003eFor testing purposes, utilize the \u003ccode\u003edebugGeography\u003c/code\u003e setting with \u003ccode\u003eUMPDebugGeographyRegulatedUSState\u003c/code\u003e to simulate a device location within a regulated US state.\u003c/p\u003e\n"]]],["To support US state regulations within the UMP SDK, ensure you have the latest SDK version and have completed the basic setup. Create a US states regulations message and manage its display alongside other messages. Use `setTagForUnderAgeOfConsent(true)` for users under the age of consent, and ensure that this tag is also set on ad requests, as the UMP SDK does not do it. After user selection, access their consent choice via local storage according to GPP. For testing, utilize `UMPDebugGeographyRegulatedUSState` or `UMPDebugGeographyOther`.\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/android/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/android/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`[setTagForUnderAgeOfConsent](/admob/android/privacy/api/reference/com/google/android/ump/ConsentRequestParameters.Builder#public-consentrequestparameters.builder-settagforunderageofconsent-boolean-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\nJava \n\n ConsentRequestParameters params = new ConsentRequestParameters\n .Builder()\n // Indicate the user is under age of consent.\n .setTagForUnderAgeOfConsent(true)\n .build();\n\n consentInformation = UserMessagingPlatform.getConsentInformation(this);\n consentInformation.requestConsentInfoUpdate(\n this,\n params,\n (OnConsentInfoUpdateSuccessListener) () -\u003e {\n // ...\n },\n (OnConsentInfoUpdateFailureListener) requestConsentError -\u003e {\n // ...\n });\n\nKotlin \n\n val params = ConsentRequestParameters\n .Builder()\n // Indicate the user is under age of consent.\n .setTagForUnderAgeOfConsent(true)\n .build()\n\n consentInformation = UserMessagingPlatform.getConsentInformation(this)\n consentInformation.requestConsentInfoUpdate(\n this,\n params,\n ConsentInformation.OnConsentInfoUpdateSuccessListener {\n // ...\n },\n ConsentInformation.OnConsentInfoUpdateFailureListener {\n requestConsentError -\u003e\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/android/privacy#force_a_geography).\n| **Note:** `UMPDebugGeographyRegulatedUSState` is only available in UMP version 3.1.0 or higher."]]