Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
More GDPR pain cometh for apps serving Ads... — Gideros Forum

More GDPR pain cometh for apps serving Ads...

MobAmuseMobAmuse Member
edited June 2023 in General questions
'Later this year, Google will require all publishers serving ads to EEA and UK users to use a Google-certified Consent Management Platform (CMP). You can use any Google-certified CMP for this purpose, including Google's own consent management solution. If you are interested in using Google's consent management solution, start by setting up your GDPR message and implementing the UMP SDK.'

https://support.google.com/admob/answer/10113005

Just sayin.
Tagged:

Comments

  • rodrirodri Member
    and how can we implement this ump sdk?
    is it possible in gideros?
    It seems that they are already starting to ask for it
  • hgy29hgy29 Maintainer
    Since it seems to be linked with AdMob currently, I would add it as an extension to AdMob plugin to start with, although getting consent from the user is more general than just for ads. We'll need to define new APIs at lua side.
    Maybe something like ads:checkConsent(consentRequirements)' which would trigger a consent result event giving the outcome of the consent request.

    Likes: dreiko65, pie, MobAmuse

    +1 -1 (+3 / -0 )Share on Facebook
  • rodrirodri Member
    hgy29 said:

    Since it seems to be linked with AdMob currently, I would add it as an extension to AdMob plugin to start with, although getting consent from the user is more general than just for ads. We'll need to define new APIs at lua side.
    Maybe something like ads:checkConsent(consentRequirements)' which would trigger a consent result event giving the outcome of the consent request.

    It would be great if it solves the admob problem.
    thank you so much.
    please notify us when available...
  • hgy29hgy29 Maintainer
    I added an ads:checkConsent({ reset=false, underAge=false }) call for AdMob. It has to be called at every app launch. 'reset' is here for debug, and 'underAge' has to be set according to the user's age.
    If the call returns true, it means consent flow is supported, and a 'AD_CONSENT' event will be triggered giving the outcome. The event has an 'error' field (textual error) and an 'errorcode' field, which is 0 if successful.

    Likes: MoKaLux, pie, MobAmuse

    +1 -1 (+3 / -0 )Share on Facebook
  • thank you so much

    we're going to try it

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
  • excuse me
    I'm a bit new to gideros...

    checkConsent fixes or implements the UMP SDK?

    I tried to add in an app, but I get this error:

    config.lua.gideros_merged:593: attempt to call method 'checkConsent' (a nil value)

    I have an object


    if application:getDeviceInfo() == "Android" then
    require "ads" --create real object for on device

    ADMOB = Ads.new('admob')
    and the call

    ADMOB:checkConsent(false, false)


    it gives me the error:

    config.lua.gideros_merged:593: attempt to call method 'checkConsent' (a nil value)


    try anyway
    ADMOB:checkConsent({ reset=false, underAge=false })

    or
    local cons
    cons=ADMOB:checkConsent(false, false)


    Do you have an example of how to implement it please? @hgy29 @MoKaLux
  • MoKaLuxMoKaLux Member
    edited August 2023
    rodri said:

    ...ADMOB = Ads.new('admob')...

    try anyway
    ADMOB:checkConsent({ reset=false, underAge=false })

    Do you have an example of how to implement it please? hgy29 MoKaLux

    Sorry I haven't tried Ads for a while, but I think this is how it should be setup:
    ADMOB:checkConsent({ reset=false, underAge=false })
    May be you need to add this code in Event.AD_CONSENT? Something like:
    ADMOB:addEventListener(Event.AD_CONSENT, function(e)
    	ADMOB:checkConsent({ reset=false, underAge=false })
    	...
    end)
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • hgy29hgy29 Maintainer
    Hi @rodri, your code should work. Are you using Gideros 2023.8 ?
  • yes
    I just installed..
  • hgy29hgy29 Maintainer
    And you rebuilt your android player with it, right ?

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
  • sorry

    I do not know how to do it...

    now install the apk GiderosAndroidPlayer.apk

    from the directory: gideros/players

    and now I get this error:

    [string "luabinding/compatibility.lua"]:79: Module ads not found
  • MoKaLuxMoKaLux Member
    edited August 2023
    the GiderosAndroidPlayer.apk that comes with Gideros doesn't have the Ads plugin built-in, you need to build GiderosAndroidPlayer.apk yourself but don't worry it is easy :)
    1. export your project
    2. in the android tab you can change the package name
    3. uncheck build android bundle
    4. check build apk file
    5. then below instead of full export, select Player (no assets)
    6. then install it on your phone :wink:
    I have it on my GH but it doesn't have the Ads plugin (couldn't make it work at the time :/ ), I will try again with the Ads plugin later ;)
    https://github.com/mokalux/gideros-player-for-android

    rodri please let me know if that doesn't help ;)
    build_android_player.png
    779 x 468 - 19K
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • hello..
    thank you...

    I was able to create the player..

    I already put a "gdpr message" in the ADMOB account

    There were 3 screen formats with consent questions. and it asked me to associate it with an application...

    I already did. I am testing on my pc, no consent screen or something similar appears here. Maybe when I publish the application in the playstore... or I'm not doing something right...

    I still don't know very well what the event is for... what I put is very simple, just this:


    CODE:

    --**************************************************
    -- *********** para GDPR *******************
    --**************************************************

    ADMOB_GDPR_READY=false

    if application:getDeviceInfo() == "Android" then
    require "ads" --create real object for on device

    ADMOB_GDPR = Ads.new("admob")

    local con=false

    con=ADMOB_GDPR:checkConsent({ reset=false, underAge=false })
    print ("consent",con)

    ADMOB_GDPR:addEventListener(Event.AD_CONSENT, function(e)
    --

    ADMOB_GDPR_READY=true
    print("event ok")
    end)


    The application works fine, but it doesn't show any consent form, maybe I'm missing something...
    thanks for your cooperation.

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
  • hgy29hgy29 Maintainer
    Hi @rodri,

    The event tells event the outcome of the consent request:
    		ads:addEventListener(Event.AD_CONSENT, function(e)
    			print("AdConsent",e.error,e.errorcode)
    		end)
    It is only fired if 'checkConsent' returnned true in first place (meaning consent flow was actually started). The error string may help you figuring out whats wrong.

    I tested with GPS version 21.5.0 without an actual admob account (I used test account).

    Likes: MoKaLux, talis

    +1 -1 (+2 / -0 )Share on Facebook
  • everything is alright

    I already tried it and it works perfectly, it activates the ADMOB consent forms...

    Prerequisites:
    You must have a GDPR message from admob configured and linked to your application...
    you can link a message to several applications...

    I did it using gideros 2023.8
    and GPS 22.3.0
    and android target version 33

    thanks for the support and regards.
    +1 -1 (+6 / -0 )Share on Facebook
  • MobAmuseMobAmuse Member
    edited October 2023
    Sorry late to my own party :blush: but I just tried all this and no go...

    I'm using latest Gideros 2023.10 with GPS 22.3.0 and target version 33 exporting and a test .apk sent to Google Pixel 8 Pro. I have published the GDPR message correctly in my AdMob account too for several apps.

    Note: I'm also using latest Android Studio Giraffe with all updates applied.

    --- Code ---

    require "ads"
    admob=Ads.new("admob")
    admob:setKey("...removed...")
    admob:checkConsent({ reset=false, underAge=false })

    admob:addEventListener(Event.AD_CONSENT, function(e)
    print("AdConsent",e.error,e.errorcode)
    end)

    --- Logcat ---

    Logcat gives me this on booting the app on the device...

    FATAL EXCEPTION: GLThread 435
    Process: com.mobileamusements.AquaSlots2TreasureIslandFREE, PID: 11637
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.ref.WeakReference.get()' on a null object reference
    at com.giderosmobile.android.plugins.ads.frameworks.AdsAdmob.checkConsent(AdsAdmob.java:457)
    at com.giderosmobile.android.plugins.ads.Ads.checkConsent(Ads.java:521)
    at com.giderosmobile.android.player.GiderosApplication.nativeDrawFrame(Native Method)
    at com.giderosmobile.android.player.GiderosApplication.onDrawFrame(GiderosApplication.java:771)
    at com.giderosmobile.android.GiderosRenderer.onDrawFrame(AquaSlots2Activity.java:509)
    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1573)
    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1272)


  • MobAmuseMobAmuse Member
    edited October 2023
    Without...

    admob:checkConsent({ reset=false, underAge=false })

    ...the code runs normally but I see no consent message of course.
  • hgy29hgy29 Maintainer
    @MobAmuse, I reviewed the code and the only reason that would lead to that crash is that the call to 'checkConsent' is issued before AdMob is compltely initialized. It turns out that the last part of intiialization started in Ads.new() is run asynchronously on UI Thread, so initialization may not be complete yet by the time you call checkConsent().

    I suggest you skip one frame before calling checkConsent() (or other calls such as showing an ad).

    Likes: MobAmuse, pie

    +1 -1 (+2 / -0 )Share on Facebook
  • Great suggestion, that worked ;)

    Thank you.

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.