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\u003eGoogleMobileAds.Ump.Api.ConsentForm provides a rendered form for collecting user consent.\u003c/p\u003e\n"],["\u003cp\u003eIt offers functionalities to load and show the consent form, including an option to automatically present it when required.\u003c/p\u003e\n"],["\u003cp\u003eIt also includes a method to display a privacy options form, giving users more control over their data.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use callbacks to handle events like form loading, dismissal, or errors.\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 if consent is needed, invoking a listener when dismissed; and `ShowPrivacyOptionsForm`, which presents the privacy options form, also with a dismissal listener. Additionally, `Show` displays a loaded consent form and calls the `onDismissed` callback. All functions can handle errors through `FormError` callbacks.\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](/admob/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](/admob/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](/admob/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](/admob/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](/admob/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. | |"]]