Search Unity

DataPrivacy.FetchPrivacyURL() is resulting in Unauthorized error

Discussion in 'Unity Analytics' started by cado82, Nov 30, 2020.

  1. cado82

    cado82

    Joined:
    Jul 29, 2020
    Posts:
    25
    The URL Generated by the GDPR service is redirecting to a site that results in the following error on Android: "Unauthorized. Invalid url or expired token". The URL loads correctly on PC.

    This is the code used to generate the URL. I followed the guide here https://docs.unity3d.com/2020.1/Documentation/Manual/UnityAnalyticsDataPrivacy.html

    Code (CSharp):
    1. public void OpenDataURL()
    2.     {
    3.         DataPrivacy.FetchPrivacyUrl(OnURLReceived, OnFailure);
    4.     }
    5.  
    6.     private void OnFailure(string reason)
    7.     {
    8.         Debug.LogWarning($"Failed to get data privacy page URL: {reason}");
    9.     }
    10.  
    11.     private void OnURLReceived(string url)
    12.     {
    13.         Application.OpenURL(url);
    14.     }
    What is causing this error and how can I prevent it for end users?


     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Thank you for the detailed description, it provides everything I need to test here. I will keep this thread updated. Can you confirm that you are not using any VPN or other network utility on your phone? Have you tested with both your phone data plan and via WiFi?
     
  3. cado82

    cado82

    Joined:
    Jul 29, 2020
    Posts:
    25
    I heard back from the user. They confirmed that they're not using any VPN or network utility on their phone. They tested with both wifi and data but they did discover that this only happens in Firefox which they're using because it "blocks tracking". They tried with Chrome and it works fine.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    So Firefox and Chrome on their phone? Regardless, If they have an ad blocker in place, this would be expected. What happens when you test it with one of your test accounts?
     
  5. cado82

    cado82

    Joined:
    Jul 29, 2020
    Posts:
    25
    Yeah, Firefox and Chrome on the phone. It works fine for me in Firefox, Chrome, and Safari on my iPhone. I don't have an Android device to test but I think this is just an issue with a browser tracking blocker on the user's phone. Probably not something that needs to be investigated further and just a one-off problem. Thanks for the assist.
     
    JeffDUnity3D likes this.