Localizing Consent SDK ConsentForm

913 views
Skip to first unread message

Mark

unread,
May 26, 2018, 6:04:06 PM5/26/18
to Google Mobile Ads SDK Developers
Hi,

I have some concerns about the text for the consent sdk's consentform being in english only.

English isn't the main language for every country the GDPR affects. I'd like to know if localization of the form's text is currently possible, if so, how, and if not, is it planned for the future.

My app supports multiple languages, if the user is in Spain (country affected by the GDPR) and their language is set to Spanish, will i be able to show the form's text in Spanish. Likewise, if their language is set to English, will i be able to show the text in that language.

The text is fine for English users, but what about the other languages my app supports. I'd greatly appreciate some information on this. Thanks.

FrankyLS

unread,
May 27, 2018, 3:44:38 PM5/27/18
to google-adm...@googlegroups.com
Sadly, the support team of this group suggested me the only (bad practise!) way to do that (for some reason, as private mail instead of public post): 

The form itself is nothing else than a HTML5 file with hardcoded strings inside tags rendered inside a WebView. You have to edit these strings.

I needed multilanguage support too, so I added multiple copies of this HTML5 file  (assets/consentform.html) and translated them to get one form for each language. 
Then I edited the code inside ConsentForm.java around webView.loadUrl() to get the multilanguage support by loading the one matching the needed language.

Attention: Inside the HTML5 file are two different forms: The big one supporting consent for personalized ads and a smaller one that appears, if only non-personalized ad consent is requested.

I didn't have time anymore to wait for something more useful so I only see this as a crappy compromise solution in the hope that there will be a better Consent SDK in the future (without the need to hack the source code of a lib to meet most basic needs like language support ).

PS: It would be nice if the small form does support the option of redirecting to the paid version too like the big one does. Furthermore, the big form could have scrolling support because it appears truncated on one of my devices if the font size is set to big in accessibility settings. 

Mark

unread,
May 27, 2018, 4:31:37 PM5/27/18
to Google Mobile Ads SDK Developers
The way you did it is the only thing i could come up with when i looked at the code, but i don't like that approach so i won't use it. Whenever they update the library, even if it's for something minor, I'd have to look over the code again.

That's why i posted my question here, perhaps there was a better way to do it yourself, or there is a plan to have the form available in different languages in the future.

In the meantime, i plan to use the consent sdk as is, but will only load the form in the EU if my apps are using the english locale. I'll just have to prevent ads from being requested for people in the EU when my apps are using a different language.

That's not ideal, but it's the most acceptable thing to do right now, as far as i can see.

FrankyLS

unread,
May 27, 2018, 4:44:23 PM5/27/18
to google-adm...@googlegroups.com
"Whenever they update the library, even if it's for something minor, I'd have to look over the code again. "

That's the problem... :-(
There is no better solution. If the strings are hardcoded, you have to edit the code in some way if you want them dynamic. Multilang support is one of the reasons why hardcoded strings are considered bad practise. :-)

I hope it lasts long enough without update until an improved Consent SDK is available. As soon it is available, I would trash the ugly stuff completely and use the Consent SDK as documented again.^^
So I didn't spend much time for that and did the easiest way of doing that. You could extract the strings into separate language files und build up the dialogs from these instead of just having multiple copies of consenform.html.

My opinion: Just using the english-only version is against the law, because these dialogs must be easily understandable and this is not the case if the user doesn't talk english. Here in germany, the english dialog is unsuitable (My experiences with that during testing: https://groups.google.com/forum/#!category-topic/google-admob-ads-sdk/android/IwHZ7WgyG6k - btw: That is the thread from where I got the instructions to edit the SDK via private message)

Currently, Content SDK forces you to work far away from the code quality level standards of my company. :-(

Mark

unread,
May 27, 2018, 5:07:23 PM5/27/18
to Google Mobile Ads SDK Developers
Well, i think that if anyone uses my apps while their device is set to English they should understand English.

I'm in charge of loading the form, so i can refuse to load it if the device is set to any other language. English is also the default language, so if my apps don't support the language the user's device is set to it will display English.

I'll just check that my app is displaying English, and only show the form if it is. I'm not legally trained, but i don't foresee a problem with that solution.

The only problem i see with this solution is that i can't display the form, or request ads, when the apps are being used by people in the EU who have their device set to any of the other languages my apps support.

Right now, i can't show any ads anywhere. At least the consent sdk allows me to filter between people in the EU and people outside of it. I'd rather get to display some ads, than none at all.

On Sunday, May 27, 2018 at 4:44:23 PM UTC-4, FrankyLS wrote:
"Whenever they update the library, even if it's for something minor, I'd have to look over the code again. "

That's the problem... :-(
There is no better solution. If the strings are hardcoded, you have to edit the code in some way if you want them dynamic. :-)

I hope it lasts long enough without update until an improved Consent SDK is available. As soon it is available, I would trash the ugly stuff completely and use the Consent SDK as documented again.^^

My opinion: Just using the english-only version is against the law, because these dialogs must be easily understandable and this is not the case if the user doesn't talk english. Here in germany, the english dialog is unsuitable (My experiences with that during testing: https://groups.google.com/forum/#!category-topic/google-admob-ads-sdk/android/IwHZ7WgyG6k)

FrankyLS

unread,
May 27, 2018, 5:14:51 PM5/27/18
to Google Mobile Ads SDK Developers
You will exclude most of european countries if you do that.

Then there would be no real difference if you exclude UK and Malta too in order to completely disable distributing ads to EEA at all (which would make the usage of Consent SDK unnecessary for you). 

Mark

unread,
May 27, 2018, 5:50:26 PM5/27/18
to google-adm...@googlegroups.com
"Then there would be no real difference if you exclude UK and Malta too in order to completely disable distributing ads to EEA at all (which would make the usage of Consent SDK unnecessary for you). "

I disagree to an extent, my goal is to display ads to as many of my app's users as i can. I don't see my solution as excluding countries, but as excluding individuals.

Those excluded individuals are those i can't currently display ads to. It's like i said before, i'd rather be able to display ads to some users rather than none.

I also don't want to block the download of my apps to EU countries, because that's too short sighted. I should still let them download it, so that i have the potential to earn revenue through them later.

Also, my app doesn't support every language spoken in the EU, which means the app will default to English. In those situations, anyone installing the app should understand English, otherwise it doesn't make sense keeping the app installed.

I think that for the time being, my solution is the best one for me. I'll have to consider other options in the future if there is no reasonable way to have the consent form displayed in any of the other languages my apps support.

mobileadssdk-a...@google.com

unread,
May 29, 2018, 12:57:06 PM5/29/18
to Mark, Google Mobile Ads SDK Developers
Hi Mark,

You are correct that the provided HTML only supports English. The recommended approach is to provide localized resources for the HTML page for the different locales you wish to support. The SDK is open source and versioned, and I don't envisage the mechanism for displaying the consent form to change in the near future.

Regards

Sam


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/2733811d-a4ae-4df1-98dd-cf53a8e63232%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark

unread,
May 29, 2018, 1:28:37 PM5/29/18
to Google Mobile Ads SDK Developers
The recommended approach is to provide localized resources for the HTML page for the different locales you wish to support.

Hi Sam,


Linking to the localization guide confuses me a bit, i'm not familiar with HTML, so are you saying i can replace the hardcoded english text with string resource ids ?

mobileadssdk-a...@google.com

unread,
May 29, 2018, 5:06:23 PM5/29/18
to Mark, Google Mobile Ads SDK Developers
Hi Mark,

No, I'm suggesting moving the html file into the res/raw folder, make the current one the default resource, then translate it into various languages and put them in the relevant res/raw subdirectory.

I believe this approach would work. Obviously the HTML would be duplicated, but apart from changing the reference in the SDK from using the assets folder to using the res/raw folder, there wouldn't be other code changes required.

Regards

Sam


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

Mark

unread,
May 29, 2018, 5:52:03 PM5/29/18
to Google Mobile Ads SDK Developers
Thanks for the suggestion, it sounds very doable. I appreciate the help.
Reply all
Reply to author
Forward
0 new messages