Unity GDPR Not showing on Build

150 views
Skip to first unread message

CSharper

unread,
Nov 19, 2023, 12:44:36 PM11/19/23
to Google Mobile Ads SDK Developers
Application ID - ca-app-pub-5678976766397557~6495539474
com.google.android.gms:play-services-ads:22.2.0

Mobile Ads SDK Forum Advisor

unread,
Nov 19, 2023, 11:41:36 PM11/19/23
to garick...@gmail.com, google-adm...@googlegroups.com
Hi,

Thank you for contacting the Mobile Ads SDK Support team.

Could you please elaborate more about the issue so that we can investigate it further?
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02qTzJp:ref"

Thanks,
 
Google Logo Mobile Ads SDK Team

 

CSharper

unread,
Nov 20, 2023, 7:04:00 PM11/20/23
to Google Mobile Ads SDK Developers
I want to implement GDPR in Unity for my game using Admob Mobile SDK - com.google.android.gms:play-services-ads:22.2.0

In Editor the modal window pops up, but on release, and on test devices it doesn't work.

Unity 2022.3.7f

Here's the implementation code:

using System.Collections.Generic;
using GoogleMobileAds.Ump.Api;
using UnityEngine;

namespace _Code.Scripts._ADS
{
    public class GDPRScript : MonoBehaviour
    {
        private ConsentForm _consentForm;
       
        // Start is called before the first frame update
        private void Start()
        {
            var debugSettings = new ConsentDebugSettings
            {
                // Geography appears as in EEA for debug devices.
                DebugGeography = DebugGeography.EEA,
                TestDeviceHashedIds = new List<string>
                {
                    "d8d9feb5-1f1a-40db-a19f-5d70eaee8f50"
                }
            };

            // Here false means users are not under age.
            ConsentRequestParameters request = new ConsentRequestParameters
            {
                TagForUnderAgeOfConsent = false,
                ConsentDebugSettings = debugSettings,
            };

            // Check the current consent information status.
            ConsentInformation.Update(request, OnConsentInfoUpdated);
        }

        private void OnConsentInfoUpdated(FormError error)
        {
            if (error != null)
            {
                // Handle the error.
                UnityEngine.Debug.LogError(error);
                return;
            }

            if (ConsentInformation.IsConsentFormAvailable())
            {
                LoadConsentForm();
            }
            // If the error is null, the consent information state was updated.
            // You are now ready to check if a form is available.
        }

        private void LoadConsentForm()
        {
            // Loads a consent form.
            ConsentForm.Load(OnLoadConsentForm);
        }

        private void OnLoadConsentForm(ConsentForm consentForm, FormError error)
        {
            if (error != null)
            {
                // Handle the error.
                UnityEngine.Debug.LogError(error);
                return;
            }

            // The consent form was loaded.
            // Save the consent form for future requests.
            _consentForm = consentForm;

            // You are now ready to show the form.
            if (ConsentInformation.ConsentStatus == ConsentStatus.Required)
            {
                _consentForm.Show(OnShowForm);
            }
        }

        private void OnShowForm(FormError error)
        {
            if (error != null)
            {
                // Handle the error.
                UnityEngine.Debug.LogError(error);
                return;
            }

            // Handle dismissal by reloading form.
            LoadConsentForm();
        }
    }
}

понеділок, 20 листопада 2023 р. о 06:41:36 UTC+2 Mobile Ads SDK Forum Advisor пише:

Mobile Ads SDK Forum Advisor

unread,
Nov 20, 2023, 8:23:45 PM11/20/23
to garick...@gmail.com, google-adm...@googlegroups.com

Hello CSharper,

Thank you for getting back to us.

Can you please confirm that you have tried to set the target to everywhere in AdMob UI settings. For more information kindly refer to the link which explains how to create GDPR messages for app.

HamsterSY

unread,
Nov 20, 2023, 11:00:38 PM11/20/23
to Google Mobile Ads SDK Developers
My app have same problem.
I find my code ConsentInformation.IsConsentFormAvailable() always return false when play with apk. 
Your ConsentInformation.IsConsentFormAvailable() will return true  on release and on test devices?
CSharper 在 2023年11月21日 星期二上午8:04:00 [UTC+8] 的信中寫道:

Mobile Ads SDK Forum Advisor

unread,
Nov 20, 2023, 11:14:25 PM11/20/23
to ujham...@gmail.com, google-adm...@googlegroups.com

Hi,

Thank you for getting back to us.

Could you please confirm that you have attempted to set the target to "everywhere" in the AdMob UI settings? For more information, please refer to the link that explains how to create GDPR messages for app.

CSharper

unread,
Nov 21, 2023, 9:50:10 AM11/21/23
to Google Mobile Ads SDK Developers
Yeah, I switched the targeting to every group. But the window still won't pop up.
вівторок, 21 листопада 2023 р. о 03:23:45 UTC+2 Mobile Ads SDK Forum Advisor пише:

Mobile Ads SDK Forum Advisor

unread,
Nov 21, 2023, 11:27:14 AM11/21/23
to garick...@gmail.com, google-adm...@googlegroups.com

Hi CSharper,

Thank you for getting back to us.

I will check with our team regarding your query and one of my team members will reach out to you once we have an update on this. Meanwhile, your patience is highly appreciated.
 

Mobile Ads SDK Forum Advisor

unread,
Nov 27, 2023, 11:26:01 PM11/27/23
to garick...@gmail.com, google-adm...@googlegroups.com
Hello,

Thanks for providing that information. Can you confirm that you followed the instructions to enable your device as a test device? Please remember that debug settings such as setting the geography to EEA do not apply in release mode.

Thanks,
Justin

ref:!00D1U01174p.!5004Q02qTzJp:ref
Reply all
Reply to author
Forward
0 new messages