Search Unity

Question Custom age gate from manual no longer works?

Discussion in 'Unity Ads & User Acquisition' started by lmbarns, Mar 11, 2023.

  1. lmbarns

    lmbarns

    Joined:
    Jul 14, 2011
    Posts:
    1,628
    I'm using Unity ads with mediation.

    The manual has an example for custom age gate: https://docs.unity.com/ads/en/manual/ImplementingCustomAgeGates

    However it doesn't mention what version of Unity that works with, and it doesn't work with 2021.3.

    The Advertisement.SetMetaData(ageGateMetaData); it appears Advertisement was under UnityEngine.Advertisement back in Unity 5, did they scrap it in newer versions without replacing it?

    Is there a way to implement a custom age gate in 2021.3? I have an age gate in my app which confirms their age, as well as privacy settings prompt for GDRP.

    The only way I can think of is to sign up for/manage 2 ads accounts, one with COPPA enabled and one without, and load the relevant account when they enter their age. Is that the best/only way?
     
  2. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    I just tested the 2021.3.0f and implemented a custom age gate, what is the specific error you are getting?

    upload_2023-3-13_15-48-2.png
     
  3. lmbarns

    lmbarns

    Joined:
    Jul 14, 2011
    Posts:
    1,628
    Thanks for verifying. Any chance you could share your using statements that worked?

    For whatever reason it doesn't work for me, if I add using UnityEngine.Advertisement; it accepts that using now but metadata "could not be found".

    I have ads with mediation installed.

    upload_2023-3-13_14-33-9.png

    upload_2023-3-13_14-34-1.png
     

    Attached Files:

    Last edited: Mar 13, 2023
  4. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    Here it is. I think something might be wrong when importing the package, how about reimporting the package or creating a new project?
    upload_2023-3-14_11-28-45.png
     
  5. lmbarns

    lmbarns

    Joined:
    Jul 14, 2011
    Posts:
    1,628
    Any idea why it doesn't work on mine with that exact same code? Notice the screenshots I put, it's red and can't compile even though it has the same using statement as you?

    Do you have Ads with Mediation installed or legacy ads? I have the latest ads with mediation installed and it doesn't work.
     
  6. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    Sounds like you are using Unity Mediation, but the manual you mentioned is for legacy ads, you can install the legacy ads SDK or use Unity LevePlay mediation(https://www.is.com/mediation/).