A new better way to get consent from EEA users.
Please read what you need to do on this link: https://developers.google.com/admob/ump/android/quick-start
Prerequisites:
You need to add your Application ID in manifest
Download library zip file and extract archive to Additional Libraries folder.
Please read what you need to do on this link: https://developers.google.com/admob/ump/android/quick-start
Prerequisites:
- Funding Choices account linked to your AdMob account.
- To create a Funding Choices account, go to Blocking Controls > EU user consent in the AdMob UI and select manage consent with Funding Choices. The Funding Choices account is then created automatically in the background.
- You also need to create Consent form and make it Active.
UserMessagingPlatform
Author: Author: Google - B4a Wrapper: Pendrush
Version: 1.01
- UserMessagingPlatform
- Events:
- OnConsentFormDismissed
- OnConsentFormLoadFailure (Error As String)
- OnConsentInfoUpdate
- OnConsentInfoUpdateFailure (Error As String)
- OnConsentInfoUpdateSuccess
- Fields:
- CONSENT_STATUS_NOT_REQUIRED As Int
- CONSENT_STATUS_OBTAINED As Int
- CONSENT_STATUS_REQUIRED As Int
- CONSENT_STATUS_UNKNOWN As Int
- CONSENT_TYPE_NON_PERSONALIZED As Int
- CONSENT_TYPE_PERSONALIZED As Int
- CONSENT_TYPE_UNKNOWN As Int
- DEBUG_GEOGRAPHY_DISABLED As Int
- DEBUG_GEOGRAPHY_EEA As Int
- DEBUG_GEOGRAPHY_NOT_EEA As Int
- Functions:
- ForceShowForm
If user is not in EEA we don't need to show a Form, also if user already give his consent he/she have a right to change it.
If Ump.ConsentStatus=Ump.CONSENT_STATUS_REQUIRED Or Ump.ConsentStatus=Ump.CONSENT_STATUS_OBTAINED Then
If Ump.IsConsentFormAvailable Then
Ump.ForceShowForm
End If
Else
Log ("We don't need to show a Form")
End If- Initialize (EventName As String, IsDebug As Boolean)
Initialize User Messaging Platform
Ump.Initialize("Ump", False)- LoadAndShowForm
Will show form only if Ump.ConsentStatus=Ump.CONSENT_STATUS_REQUIRED, if form is not shown OnConsentInfoUpdate event will fire
For user out of EEA zone Ump.IsConsentFormAvailable will be False, but also Google give some info why form maybe unavailable:
There are a variety of reasons why a form may not be available, such as:
The user has limited ad tracking enabled.
You tagged the user As under the age of consent.
Read more on this link: https://developers.google.com/admob/ump/android/quick-start- Reset
Reset Consent state
In testing your app with the UMP SDK, you may find it helpful to reset the state of the consent SDK
so that you can simulate a user's first install experience.
Use reset right after Initialize and use it ONLY FOR TESTING.- Properties:
- ConsentStatus As Int [read only]
Get Consent status
If Ump.ConsentStatus=Ump.CONSENT_STATUS_NOT_REQUIRED Then
Log ("NOT_REQUIRED")
Enf If- ConsentType As Int [read only]
Get Consent type
If Ump.ConsentType = Ump.CONSENT_TYPE_PERSONALIZED Then
Log ("PERSONALIZED")
Enf If- DebugGeography As Int [write only]
This line is for TESTING only and MUST BE set before Initialize method
Ump.DebugGeography = Ump.DEBUG_GEOGRAPHY_EEA- IsConsentFormAvailable As Boolean [read only]
Check is Consent Form available
There are a variety of reasons why a form may not be available, such as:
The user has limited ad tracking enabled.
You tagged the user As under the age of consent.
Read more on this link: https://developers.google.com/admob/ump/android/quick-start- TestDeviceHashedId As String [write only]
This line is for TESTING only and MUST BE set before Initialize method
Use unfiltered log to find your TestDeviceHashedId - Line look like this:
Use new ConsentDebugSettings.Builder().addTestDeviceHashedId("43AC6A74FCA5ABEAF9DF0214C5179153")
Ump.TestDeviceHashedId = "YOUR_TEST_DEVICE_ID"
You need to add your Application ID in manifest
B4X:
AddApplicationText(<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-XXXXXXXXXXXXXXX~YYYYYYYYYY" />)
Download library zip file and extract archive to Additional Libraries folder.
Attachments
Last edited: