New Requirements from Google to show ads - CMP

This should be fixed, ty for pointing out

1 Like

Hey @Scott_Harrison Iā€™ve noted that the documentation include the new functions outside from the Admob initialization. Should I include this calls inside the ā€œinitā€ phase of Admob?

Look at this example:

local function adListener( event )

if (event.phase == "loaded" and event. type == "ump" ) then

admob.showConsentForm()

end

end

admob.init( adListener, { appId= "YOUR_ADMOB_APP_ID" } )

local formStatus, consentStatus = admob.getConsentFormStatus()

if (formStatus == "available" ) then -- recommend (not required)

admob.loadConsentForm()

end

Thank you for the quick action on this.

Two questions -

  1. In the Admob dashboard, it has an option to create a GDPR message. Do we need to do this ourselves (any tips on what to write??), or will Admob provide an acceptable default message?

  2. How do we test this consent form on our app after we implement it, especially if weā€™re not in Europe? (I guess I could set my VPN to Europe?)

Admob has their own UMP to create the message. It is very easy to created it, so you donā€™t have to write anything, just follow the stepsā€¦

  1. There is a debug option
1 Like

The consent form is not dependent on init event or admob.init() (other then the listener)

So itā€™s really your preference

Great, thank you!

Has anyone gotten this to work yet?

When I run:
local formStatus, consentStatus = admob.getConsentFormStatus()
I get:
Form Status: unavailable Consent Status: unknown

Iā€™m also getting the error:
ERROR: admob.updateConsentForm( [options] ), Invalid option 'underage'

On my AdMob dashboard under Privacy & messaging the GDPR message is ā€œOnā€, the status is ā€œPublishedā€ and the app Iā€™m testing it with is selected. Iā€™m about four hours into debugging this and Iā€™m out of ideas.

I am also having trouble getting this to work.
admob.getConsentFormStatus() returns a formStatus of ā€œunknownā€ and consentStatus of ā€œunknownā€ for me.

In admob my message is ā€˜onā€™ and the status is ā€˜publishedā€™ as well.

Iā€™m not sure if this has anything to do with it, but my app is currently in development and is not listed in the app store yet, therefore my app in admob has a status of ā€œrequires reviewā€.

Hello.
I am having the same problem.

The admob.getConsentFormStatus function returns formStatus as ā€œunavailableā€ and contentStatus as ā€œunknownā€.
In the admob dashboard, the message is ā€˜onā€™ and the status is also ā€˜publishedā€™.
By the way, if you call the admob.getConsentFormStatus function immediately after the admob.init function as per the documentation, it returns the following error.

ERROR: admob.getConsentFormStatus( ), You must wait for the ā€˜initā€™ event before calling other API functions

So I solved this by calling the getConsentFormStatus function from within adListener.

Hey @silent12o Iā€™m glad youā€™ve tested it. @Scott_Harrison says that those functions are independent from the ā€˜initā€™ phase but I suspected that canā€™t be that way, so I implemented admob.getConsentFormStatus in the init phase.

1 Like

Hey yeah, sorry I misspoke, I just remembered you do need to after init phase because of the way the init checking is done. Will update doc samples to reflect this

2 Likes

Thank you @Scott_Harrison

1 Like

I donā€™t think thatā€™s the main problem though. I was doing everything related to the UMP well after init and getting unavailable and unknown.

2 Likes

I still havenā€™t gotten this to work yet, but I have made progress on ios.

Originally I was receiving a formStatus of ā€œunknownā€ and consentStatus of ā€œunknownā€.

My app is still in development, so I never setup my payment profile in AdMob. I didnā€™t think this would prevent me from testing as I could still setup an App and message in AdMob. Yesterday I supplied the remaining profile information that AdMob was requesting. Now it appears I can utilize the UMP APIs.

On ios I now get a formStatus of ā€˜availableā€™ and a consentStatus of ā€˜requiredā€™. I am able to successfully invoke the admob.loadConsentForm() to load the form (I can tell it is successful based on the event). However, I have not been able to display the form. When I invoke admob.showConsentForm() nothing happens. My event listener does not get triggered.

Unfortunately, on Android I am getting a formStatus of ā€œunavailableā€ and consentStatus of ā€œunknownā€.

@Scott_Harrison I pulled the AdMob repo to help me triage why the consent form isnā€™t showing for me on ios.

In the AdMobPlugin::showConsentForm(lua_State *L) method I noticed that this condition fails because adInstance is blank.

// show form
CoronaAdMobAdInstance *adInstance = admobObjects[@"ump"];
if(adInstance && adInstance.isLoaded == true)

In the ā€œAdMobPlugin::loadConsentForm(lua_State *L)ā€ method I added this code which seemed to resolve the issue.

admobObjects[@"ump"] = adInstance;

I havenā€™t triaged the issue I am having for Android yet.

1 Like

@Scott_Harrison thanks for updating the iOS implementation. Iā€™m able to display the consent form now.

I think I see an issue with the Android implementation. In the updateConsentForm method it looks like it always returns 0 since it checks that the key is equal to ā€œunderageā€ and ā€œdebugā€.

I think we just need to replace this

                        } else {
                            logMsg(ERROR_MSG, "Invalid option '" + key + "'");
                            return 0;
                        }

                        if (key.equals("debug")) {

with

                       } else if (key.equals("debug")) {
1 Like

Admob updated the message on the console. Now it says "Beginning January 16, 2024, Google will require "ā€¦

1 Like

yes they have pushed it back based on publisher feedback. gives us some more time to transition!

Is this working for Google Play now? Was the suggestion by @Sandhive valid and if so implemented @Scott_Harrison?