Stay organized with collections
Save and categorize content based on your preferences.
A rendered form for collecting consent from a user.
Summary
Public functions
|
Show(Action< FormError > onDismissed)
|
void
Shows the consent form.
|
Public static functions
Public functions
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[null,null,["Last updated 2025-08-20 UTC."],[[["\u003cp\u003e\u003ccode\u003eGoogleMobileAds.Ump.Api.ConsentForm\u003c/code\u003e provides a rendered form for obtaining user consent.\u003c/p\u003e\n"],["\u003cp\u003eIt offers functionalities to load, show, and manage consent and privacy options forms.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use methods like \u003ccode\u003eLoad\u003c/code\u003e, \u003ccode\u003eLoadAndShowConsentFormIfRequired\u003c/code\u003e, \u003ccode\u003eShowPrivacyOptionsForm\u003c/code\u003e, and \u003ccode\u003eShow\u003c/code\u003e to interact with the forms.\u003c/p\u003e\n"],["\u003cp\u003eCallback mechanisms are provided to handle form loading, showing, and dismissal events.\u003c/p\u003e\n"],["\u003cp\u003eThis API facilitates compliance with user privacy regulations and preferences by managing consent collection and privacy options display within your app.\u003c/p\u003e\n"]]],["The `ConsentForm` facilitates user consent collection. Key actions include: `Load`, which retrieves a consent form via a callback; `LoadAndShowConsentFormIfRequired`, which displays the form only if consent is needed; `ShowPrivacyOptionsForm`, which presents privacy options; and `Show`, which displays a previously loaded consent form. All functions use a callback to report errors or the result of dismissing a form. The forms are for showing consent and privacy options to users.\n"],null,["# GoogleMobileAds.Ump.Api.ConsentForm Class Reference\n\nGoogleMobileAds.Ump.Api.ConsentForm\n===================================\n\nA rendered form for collecting consent from a user.\n\nSummary\n-------\n\n| ### Public static functions ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|\n| [Load](#class_google_mobile_ads_1_1_ump_1_1_api_1_1_consent_form_1af298443dbc31debf7f03da00af1fa72e)`(Action\u003c `[ConsentForm](/ad-manager/mobile-ads-sdk/unity/reference/class/google-mobile-ads/ump/api/consent-form#class_google_mobile_ads_1_1_ump_1_1_api_1_1_consent_form)`, `[FormError](/ad-manager/mobile-ads-sdk/unity/reference/class/google-mobile-ads/ump/api/form-error#class_google_mobile_ads_1_1_ump_1_1_api_1_1_form_error)` \u003e formLoadCallback)` | `void` Loads a consent form. |\n| [LoadAndShowConsentFormIfRequired](#class_google_mobile_ads_1_1_ump_1_1_api_1_1_consent_form_1a8f1748d822a64ba3a90b4af51383e5a7)`(Action\u003c `[FormError](/ad-manager/mobile-ads-sdk/unity/reference/class/google-mobile-ads/ump/api/form-error#class_google_mobile_ads_1_1_ump_1_1_api_1_1_form_error)` \u003e onDismissed)` | `void` Load and show the consent form when the user consent is required but not yet obtained. |\n| [ShowPrivacyOptionsForm](#class_google_mobile_ads_1_1_ump_1_1_api_1_1_consent_form_1a5c231fce4ff4e65b79d4f50ad82478ff)`(Action\u003c `[FormError](/ad-manager/mobile-ads-sdk/unity/reference/class/google-mobile-ads/ump/api/form-error#class_google_mobile_ads_1_1_ump_1_1_api_1_1_form_error)` \u003e onDismissed)` | `void` Show the privacy options form when the privacy options button is required. |\n\n| ### Public functions ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------|\n| [Show](#class_google_mobile_ads_1_1_ump_1_1_api_1_1_consent_form_1a7d42375de90e934a03a820cc3422f985)`(Action\u003c `[FormError](/ad-manager/mobile-ads-sdk/unity/reference/class/google-mobile-ads/ump/api/form-error#class_google_mobile_ads_1_1_ump_1_1_api_1_1_form_error)` \u003e onDismissed)` | `void` Shows the consent form. |\n\nPublic static functions\n-----------------------\n\n### Load\n\n```c#\nvoid Load(\n Action\u003c ConsentForm, FormError \u003e formLoadCallback\n)\n``` \nLoads a consent form.\n\n\u003cbr /\u003e\n\n| Details ||\n|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |--------------------|------------------------------------------------------------------| | `formLoadCallback` | Called when the client loads a consent form or returns an error. | |\n\n### LoadAndShowConsentFormIfRequired\n\n```c#\nvoid LoadAndShowConsentFormIfRequired(\n Action\u003c FormError \u003e onDismissed\n)\n``` \nLoad and show the consent form when the user consent is required but not yet obtained.\n\n\u003cbr /\u003e\n\n| Details ||\n|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |---------------|------------------------------------------------------------------------------------| | `onDismissed` | The listener that gets called when the consent form is dismissed or fails to show. | |\n\n### ShowPrivacyOptionsForm\n\n```c#\nvoid ShowPrivacyOptionsForm(\n Action\u003c FormError \u003e onDismissed\n)\n``` \nShow the privacy options form when the privacy options button is required.\n\n\u003cbr /\u003e\n\n| Details ||\n|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |---------------|--------------------------------------------------------------------------------------------| | `onDismissed` | The listener that gets called when the privacy options form is dismissed or fails to show. | |\n\nPublic functions\n----------------\n\n### Show\n\n```c#\nvoid Show(\n Action\u003c FormError \u003e onDismissed\n)\n``` \nShows the consent form.\n\n\u003cbr /\u003e\n\n| Details ||\n|------------|-------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |---------------|--------------------------------------------| | `onDismissed` | Called when the consent form is dismissed. | |"]]