I was asking you. Was wondering why your consent rate was so low. Its legal to select those options, if Google is providing them
So for those who donāt approve the consent, do you give them an alert with the option to show the dialog again to accept consent to continue using the app or do you force os.exit() directly ?
I made my own mediation system to show unity ads to those not getting admob ads loaded but since Admob pay is better than UnityAds, I may try your method too.
The consent doesnāt go away. I have disabled the close and the ādo not consent buttonā from the UPM control panel. I am using Ironsource, and as I wrote above, I canāt even initialize Ironsource before consent. I plan to introduce the remove consent button, and I think in that case, I will let them know that they need to close the game and delete it. If they decide to relaunch it without deleting it, then they will get the consent again.
oh btw my consent rate is more accurate after days now, 2000 forms shown and %69 approval rate now.
With the same settings?
yeah never changed, close button off, do not consent button on.
Iām finally taking another crack at getting the CMP up and running, and Iām hitting a weird snag when I test on an Android device, installed via adb.
Iām calling admob.updateConsentForm( { underage = false } )
in my AdMob listener on event.phase == "init"
.
Then, ten seconds later, I call local formStatus, consentStatus = admob.getConsentFormStatus()
, and I get a Runtime error: attempt to call field 'getConsentFormStatus' (a nil value)
The commands are all copy/pasted straight out of the docs, so spelling shouldnāt be an issue, and the rest of AdMob is working fine- loading and displaying ads, no problem. I also confirmed in my plugins folder that Iāve got the latest version of the AdMob plugin downloaded onto my computer.
Any thoughts?
This had completely skipped my mind. I just made a PR to the docs with more complete code examples and gotchas.
Hereās a complete code example on how to show the consent form (this will be added to the showConsentForm documentation page once the PR goes through):
local admob = require( "plugin.admob" )
local function adListener( event )
if ( event.phase == "init" ) then
-- Wait until "init" phase to update the Consent Form.
admob.updateConsentForm({ underage=false })
-- Add a slight delay to allow the plugin to finish initializing and updating the Consent Form before trying to get the form.
timer.performWithDelay( 1000, function()
local formStatus, consentStatus = admob.getConsentFormStatus()
print( "formStatus: " .. tostring( formStatus ) .. ", consentStatus: " .. tostring( consentStatus ) )
if (formStatus == "available") then
admob.loadConsentForm()
end
end )
end
-- Successfully loading the Consent Form will trigger a "ump" type event.
if (event.phase == "loaded" and event.type == "ump") then
-- The Consent Form is available, loaded and ready to be shown.
admob.showConsentForm()
end
end
-- Initialize the AdMob plugin.
admob.init( adListener, { testMode=true } )
One of the many upcoming gotchas is:
You must wait after running
admob.updateConsentForm()
beforeadmob.getConsentFormStatus()
returns non-nil values.
Hmmā¦ Iām waiting 10 seconds before calling admob.getConsentFormStatus
, so I think Iām having a different problem.
Also, I really think itās time to retire appId="YOUR_ADMOB_APP_ID"
as a param for admob.init
in the docs. It always returns WARNING: admob.init(listener, options), AppId is ignored and should be in build.settings
.
Yeah, thatās a good point. I just copied the existing example code, which uses that. My own projects or client projects have those IDs in build.settings like you mentioned.
Have you set up the message in the AdMob portal?
Edit: Iāve just amended my PR to remove mentions of appId in admob.init(). Iāll edit my post above as well to remove it.
Yeah- I created a GDPR message back in June. I just went through it and confirmed that its status is āPublishedā and that the app Iām testing with is linked to the message.
According to some light Googling the error message attempt to call field 'foo' (a nil value)
typically indicates that the function being called hasnāt been defined, which is what led me to do things like check my version of the AdMob plugin.
I guess Iāll try sending this up to Internal Testing on Play and see if installing it from there makes any difference. Iāve had trouble in the past with AdMob when Iād side loaded an .apk using ADB instead of downloading the .aab from Play. Using registered test devices fixed those problems, but maybe the CMP is particular about that.
That sounds to me like youāre running a different version of the plugin. One that doesnāt have the new API yet.
First, make sure youāre not requesting a specific version of AdMob in your build.settings. If youāre not, then empty any cached plugins you may have.
If you run the following code, then the new API should appear in the console output, even when running on the simulator:
local admob = require( "plugin.admob" )
for k, v in pairs( admob ) do
print( k, v )
end
If you donāt see getConsentFormStatus
listed there, then you have an outdated version of the plugin.
I knew this problem smelled weird, and I solved it in the most unsatisfactory way. I rebooted my computer, did a new build and now everything works as expected.
I have gotten some question about existing apis that exist and if they are still necessary/need with CMP
for admob.load()
āhasUserConsentā is no longer needed (source: āhttps://groups.google.com/g/google-admob-ads-sdk/c/I6j0Pr-_ziY/m/VOH06zsWAQAJā) and is been replaced by CMP, this will be removed from docs and deprecated
āchildSafeā and ādesignedForFamiliesā are still necessary for serving child safe ads and ads for apps designed for families
Iām currently implementing Admobās GDPR requirements.
In the XeduR source code, the calling condition part of admob.showConsentForm() needs to be placed outside event.phase == āinitā, right?
- It was written correctly in the admob documentation.
One question: The condition for calling admob.loadConsentForm() is formStatus=āavailableā, but in this case, the form will be displayed to the user every time. Is this the intended design?
Do I also need to include consentStatus=ā³requiredā in the condition if I donāt want it to appear every time?
Granted, I didnāt do much testing without consentStatus=ā³requiredā
as part of the decision for when to show the message, but in theory, it would not only show it over and over again (far from an ideal user experience), but it would also show the message to people outside the EU.
OK, I finally managed to successfully get the consent form showing up in my Android app! Here are some observations which I think are worth mentioning again:
(1) a) For Android I had to use āadb logcatā to find the debug test device ID to use for testDeviceIdentifiers:
e.g.
12-14 18:01:18.314 13306 13448 I UserMessagingPlatform: Use new ConsentDebugSettings.Builder().addTestDeviceHashedId("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx") to set this as a debug device.
Originally I thought it was the value shown in the āadb devicesā command but thatās a different value.
b) For iOS, I need to check the console for this line:
[Device] <UMP SDK> To enable debug mode for this device, set: UMPDebugSettings.testDeviceIdentifiers = @[ @"<xxxxxxxxxxxxxx" ];
This is not the Apple UDID for your device.
(2) If you have an ad blocker enabled on your router such as Pi Hole, turn it off, because it will also block the consent form! I know this sounds obvious, but Iām dumb and I kept getting āformStatus = unavailableā and got no consent form until I disabled my Pi Hole.
I also have a couple of questions:
-
Whatās a good example message to use in the consent form, other than the default "YOUR_APP asks for your consent to use your private data to:", which sounds a little shady.
-
Can I keep the ādebugā parameters for geography=āEEAā and testDeviceIdentifiers in my updateConsentForm() call when I upload the final version to the store? Just want to make sure.
This is the consent state I had initially:
consentStatus: unknown
After I set the test device ID and EEA region, I got:
consentStatus: required (form shows up)
Upon subsequent launches of the app, the form still showed up, and:
consentStatus: obtained
I think as @umalemon said, we should add an additional condition with consentStatus so that the form only shows up once:
if (formStatus == "available" and consentStatus == "required") then
admob.loadConsentForm()
end
Finally, I implemented this on a different game. Thank you for your code, this is what my code looks like now.
if event.phase == "hidden" and event.type == "ump" then
local formStatus, consentStatus = admob.getConsentFormStatus()
if (formStatus == "available" and consentStatus == "obtained") then
adProvider.loadAds()
end
elseif event.phase == "refreshed" and event.type == "ump" then
local formStatus, consentStatus = admob.getConsentFormStatus()
if (formStatus == "available" and consentStatus == "required") then
admob.loadConsentForm()
else
adProvider.loadAds()
end
Thank you.
I have succeeded in displaying the consent form.
However, when the form is closed by tapping the button, the adListener does not return event.type==āumpā,event.phase==āhiddenā.
This symptom only occurs on android device.
ios device have no problems.
Does anyone else have the same symptoms?
[development environment]
solar2d ver : 2023.3699
device : Xperia 10 iii lite
android os ver : 12