Issue in Admob : Consent requirement: No CMP

One of my apps has repeatedly presented the same issue in the Admob console (Consent requirement: No CMP) and because of this Admob has restricted the display of ads in my app.

Issue description
Consent requirement: No CMP
Some ad requests on your inventory from the EEA, the UK, or Switzerland do not include a TC string from a certified consent management platform (CMP). Publishers must use a certified CMP registered with the IAB’s Transparency and Consent Framework (TCF) when serving ads to users in the EEA, the UK, and Switzerland.

Now, we all have practically the same implementation of the Admob listener for the Consent Form like this:


local adsReady = false

local adsListener = function( event )
    
    if ( event.phase == "init" ) then
        
        admob.updateConsentForm()
        
        -- Add a slight delay to allow the plugin to finish initializing and updating the Consent Form before trying to get the form.
        timer.performWithDelay( 2500, function()
            local formStatus, consentStatus = admob.getConsentFormStatus()
            
            if ( consentStatus == "required" and formStatus == "available" ) then
                admob.loadConsentForm()
            else
                adsReady = true -- -- now you can show ads (this could be causing the issue)
            end
        end)
        
    elseif ( event.phase == "loaded" ) then
        
        if ( event.type == "ump" ) then
            
            admob.showConsentForm()
            
            adsReady = true -- now you can show ads
            
        else
            -- 
        end
        
    end
end

admob.init( adsListener )

I think the problem is in the waiting time to decide if the Consent Form has finished initializing and updating. If one knew what the minimum time for this would be, it would be great, but it is very relative since it depends on the user’s internet speed among other things.
My question is: Is there no way to have a callback for when the Consent Form is initialized and updated and thus avoid the issue that Admob is showing me?

There should be a event.phase == “refreshed” for event.type == “ump” when admob.updateConsentForm() is completed

Thank you, @Scott_Harrison . When you said ‘completed’, did you mean that is the moment to load the Consent Form (admob.loadConsentForm())?

I’ve seen a code from Agramonte and he does’nt use a timer before load the Consent Form. This is the code from him:


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

For
.loadConsentForm()
events
event.type == “ump"
“success”
event.phase == “loaded”
“failed”
event.phase == “failed”

1 Like

Thank you @Scott_Harrison