• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Android Google Consent SDK - works 1st time only on device

D

degziebob

Guest
Hi,

As part of GPDR I'm using the GooglePlayServicesExtension (3.1.1) to showthe consent form , latest GMS2, Android Build: 28.03, Support lib: 28.0.0, target SDK: 28, Minimum SDK: 19, Compile SDK: 28

If I use a virtual android device for testing (Android studio) the following will run and normally (say 80% of the time) run the GPDR popup.

global.ads_consent_id="<MYID>"
GoogleMobileAds_Init("", global.ads_app_id);
GoogleMobileAds_ConsentDebugAddDevice("<removed>");
GoogleMobileAds_ConsentDebugSetDeviceInEEA(true);
global.ads_consent_id = "pub-1XXXXXXXXX"
global.ads_privacy_url = "https://www.myurl.com";
GoogleMobileAds_ConsentUpdate(global.ads_consent_id, global.ads_privacy_url, true, true, true);

The above works, and via an Async event I get the value and set it - and that's all good but I'm trying to rerun that popup as you have to give the person the option to change it. I can't get it to show a second time.

I ran the above on my Android phone and the very first time it ran I got the popup and set it to Personalised ads - that works - but it will not show again. I must be doing something really daft, any ideas?

2) There is a function the SDK called GoogleMobileAds_ConsentIsUserInEEA() which I was hoping to call and then return the EEA value - but it never runs and no value is set, no Async value returns... From the Android forums (not GMS) that looks to be possible, but can't get it to return anything.


I followed this article: https://help.yoyogames.com/hc/en-us/articles/360019956652-iOS-and-Android-Google-Consent-SDK

If anyone has a demo to a working GMS sdk popup that would be awesome.

Thanks.
 
D

degziebob

Guest
I found this last night GoogleMobileAds_ConsentFormShow() but it just errored, now I have read the error properly when I call it using:

GoogleMobileAds_ConsentFormShow(global.ads_privacy_url,true,true,true)

I get:
05-31 11:36:43.702 14323 14350 I yoyo : Attempting to show consent form.
05-31 11:36:43.702 14323 14350 I yoyo : InvocationTargetException thrown trying to call method GoogleMobileAds_ConsentFormShow on GooglePlayServicesExtension
05-31 11:36:43.702 14323 14350 I yoyo : Target exception: Can't create handler inside thread Thread[GLThread 439,5,main] that has not called Looper.prepare(). Cause: null. Stack trace:
05-31 11:36:43.702 14323 14350 I yoyo : java.lang.RuntimeException: Can't create handler inside thread Thread[GLThread 439,5,main] that has not called Looper.prepare()

Any ideas?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Hi there! Could you please file a bug report? Include a download link to the project if possible, and also a link to this topic. Thanks!
 
B

BobbySonOfRasmus

Guest
Was this resolved? I am having a similar issue (for iOS in xcode) where I cannot get the consent form to fire and, based on the error message from the async call back, it is due to the test device not being in the EEA region. I am using this...

Code:
GoogleMobileAds_Init("", ads_app_id);
GoogleMobileAds_ConsentDebugAddDevice(ads_device_id);
GoogleMobileAds_ConsentDebugSetDeviceInEEA(true);
...to add the device to EEA, and unfortunately, still no luck. I even changed my device region to Germany and VPNed through Germany (just to cover all possible bases) and still no luck. I am still receiving the error:

Code:
Error: request is not in EEA or unknown.
It seemed somewhat related to OP's issue, so figured I would bump this thread.
 
D

degziebob

Guest
I logged a ticket a month ago, got no response.

I found a workaround by using this and it works fine for me... I read that within googles code its essentially just connecting to that api (url) and getting the response.


global.result_post = http_get("https://adservice.google.com/getconfig/pubvendors");

then in an http Async:

eea_result=-1 //default so it it doesn't get a value back it assumes we haven't checked -it'll check again on next launch
var json = async_load[? "result"];
if string(json) != "" and string(json) != "undefined" {
var map = json_decode(json)
if (map=-1) {exit } //error inside this
if (ds_map_exists(map,"is_request_in_eea_or_unknown")) {
eea_result=ds_map_find_value(map,"is_request_in_eea_or_unknown")
} else {
eea_result=0
}
}
 
B

BobbySonOfRasmus

Guest
Okay this makes sense then. It seems the test device setup is not working as expected. I have finally been able to get the Google consent sheet to fire but only after I used a VPN on the device itself. Apparently you are right in that the consent sdk seems to be checking the actual location of the device and not the region it is set in (or even in the app store it is downloaded from).
 
D

degziebob

Guest
Hi,

It looks like this may now be fixed, just got this:

"Sorry for the long delay in responding. The 3.1.2 version of the Google Play Services extension had some fixes for the consent form, and we have now today released version 3.1.3 of the extension, which fixes a couple more issues and updated the version of the ad library being targeted, so hopefully you'll find that if you update the extension in your project to 3.1.3, then your issue no longer occurs.

Please note if you haven't already, you will need to update to GMS2 2.2.3 as well before you can use the new Google Play Services extension, otherwise you will get an error when trying to build your project."

You might want to give that a go and see if it solves your problem too.

Cheers.
 
C

cageist

Guest
I'm using the latest stable IDE and runtime (2.2.3) and latest extension (3.1.3) and still getting the same error when trying to call GoogleMobileAds_ConsentFormShow() and GoogleMobileAds_ConsentIsUserInEEA() still doesn't work. (Although it's hard to be sure when there's no help file or manual).
 
Last edited by a moderator:
G

Guest

Guest
Is there any reason not to just manually get the user's consent, i.e., code a screen with a privacy explanation and "agree" button yourself?

I was waiting for YYG to fix this, but then I decided I didn't want to (1) wait, (2) rely on them to keep it working, or (3) rely on a third party like Kaguva or Mert to keep it working until they wake up and switch game engines, so I coded a screen myself. Am I missing something?
 
C

cageist

Guest
Is there any reason not to just manually get the user's consent, i.e., code a screen with a privacy explanation and "agree" button yourself?

I was waiting for YYG to fix this, but then I decided I didn't want to wait or---more to the point---rely on them to keep it working (or rely on a third party to keep it working until they suddenly switch engines), so I coded a screen myself. Am I missing something?
Well you wouldn't want to show the consent if they're outside of the EEA as it's not needed. And if you're using personalized ads, if the user is in the EEA you need to provide a link to the privacy policy for each ad provider (not Google Play, the ad providers like Facebook etc, by default there are hundreds). And you need to give an option to turn off personalized ads and update that with Google so they stop serving the personalized ads and just send anonymous ones. Plus you need a way to retrigger the form if the user changes their mind. Also they need to be over the age of consent for their country (13-16) for EEA as you can't collect data on children for the personalized ads even if they agree. Plus you want to cache the result from the form with Google so it only pops up the first time you run the game, not every single time. Basically it's a huge pain in the ass
 

Andrey

Member
Well you wouldn't want to show the consent if they're outside of the EEA as it's not needed. And if you're using personalized ads, if the user is in the EEA you need to provide a link to the privacy policy for each ad provider (not Google Play, the ad providers like Facebook etc, by default there are hundreds). And you need to give an option to turn off personalized ads and update that with Google so they stop serving the personalized ads and just send anonymous ones. Plus you need a way to retrigger the form if the user changes their mind. Also they need to be over the age of consent for their country (13-16) for EEA as you can't collect data on children for the personalized ads even if they agree. Plus you want to cache the result from the form with Google so it only pops up the first time you run the game, not every single time. Basically it's a huge pain in the ass
In my opinion, independent creation of consent forms and other things is much more reliable. This can be perfectly fit into the design of the game. I'm showing the consent form to the whole world.
 
C

cageist

Guest
In my opinion, independent creation of consent forms and other things is much more reliable. This can be perfectly fit into the design of the game. I'm showing the consent form to the whole world.
If you're using the Google Consent SDK (not the YoYo version) and making your own extension with it, then I agree. If not, then I doubt your form meets the legal requirements.
 

Andrey

Member
If you're using the Google Consent SDK (not the YoYo version) and making your own extension with it, then I agree. If not, then I doubt your form meets the legal requirements.
You can display any form of consent before the ads initialization. Ask what you want, given the laws. Once obtained the consent, initialize advertising, setting appropriate restrictions on the showing of age, geotargeting.
 
C

cageist

Guest
You can display any form of consent before the ads initialization. Ask what you want, given the laws. Once obtained the consent, initialize advertising, setting appropriate restrictions on the showing of age, geotargeting.
That sounds ideal, but maybe a lot of work. Even though I've got the Google form working, I would be interested to see how you have implemented this.
 
G

Guest

Guest
I'll post a screenshot of mine later (on mobile now), but a question for all of you---I know @Mert said in another thread that you have to give the option for non-personalized ads, but I haven't been able to find that as a requirement anywhere... Is there any source for that?

Right now I have it implicitly require personalized ads or else not use the game.

Edit: attached the screen, I forgot that mine is a phone game and phones take screenshots.
 

Attachments

Last edited by a moderator:

Mert

Member
Whenever you call a ANY ADS, you simple request an ad by configuring an AdRequest object(That is in Java). When building a request, you may add several parameters to it.

* For example, if you add tagForChildDirectedTreatment(true) to this request, the AD that'll be requested will be suited for children
* You may add "Android Bundles" to this request, like putBoolean("tag_for_under_age_of_consent", true); to make it compatible with EU Age Consent laws.
* Or extras.putString("max_ad_content_rating", "MA"); to say "My App is suitable only for mature audiences; includes topics such as alcohol, gambling, sexual content, and weapons.

The issue is, under GDPR you must keep a clean record of the consent too. Just directing it, is not enough(Unless you have a solid, good working consent collection mechanism). This is why the Consent SDK is created, and there are consent collecting services.

I'll post a screenshot of mine later (on mobile now), but a question for all of you---I know @Mert said in another thread that you have to give the option for non-personalized ads, but I haven't been able to find that as a requirement anywhere... Is there any source for that?

Right now I have it implicitly require personalized ads or else not use the game.

Edit: attached the screen, I forgot that mine is a phone game and phones take screenshots.
It's against GDPR yea. You cannot say "Accept this or leave my game" :D

You know what, I'll create an Admob extension. I needed one for myself anyways.
 
C

cageist

Guest
...
...
You know what, I'll create an Admob extension. I needed one for myself anyways.
If the extension checked the players age I would definitely buy it, that is the most mind boggling to me, because every EU country has different age of consent. And the consent data is stored with Google (I think) but the age data is not. It makes me upset just thinking about it. Lol
 

DireMind

Member
Has the OPs issue been resolved? I have the same issue. I can show the consent form once and then never again. Only a reinstall of the app will allow the consent form to show again.

I've tried using "GoogleMobileAds_ConsentFormShow(global.ads_privacy_url,true,true,true)" but this doesn't seem to do anything. Anyone have any luck getting the consent form to show more than once? I'd like to offer users the chance to make a change.
 
Top