Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Question Getting player location for policies and consent in SDK v5.0.1

Discussion in 'Unity Analytics' started by rjc, Oct 23, 2023.

  1. rjc

    rjc

    Joined:
    Oct 15, 2012
    Posts:
    5
    I'm going through the process of migrating the Analytics SDK to v5.0.1. The new intialising flow seems a lot simpler and definitely feels like a positive change.

    When it comes to determining the player's location and which policies apply to them, I'm wondering what the best practice is for doing so or how other people have been accomplishing this? I've been weighing up my options but none seem completely straight forward.

    Option 1: Ask the player
    • Seems simple enough to implement and doesn't require an internet connection.
    • Is this compliant with each of the policies? Seems easy enough to lie about your location.
    • Requires an inconvenient level of granularity for providing the player with options. Some policies are bound to countries (GDPR, PIPL) and others to states (CCPA).
    Option 2: Device GPS
    • Looks like I can hook into Unity's LocationService for this.
    • Requires an internet connection
    • Requires device level permissions for accessing location data. This isn't ideal, I'm making a casual word game and asking players for permission to use their location in this context feels gross.
    Option 3: IP Location Service
    • This feels like it might be the best option.
    • Requires an internet connection.
    • This feels like I'm circumventing the device's location policies. Is it compliant with privacy policies to query the location of a user without them being aware?
    I'm also going to make the assumption that in the case where an internet connection is unavailable and the player has not yet opted in or out of analytics then I don't need to call StartDataCollection or StopDataCollection.

    Also, previously GDPR and CCPA automatically opted in. Is it still safe to do so?

    I'd appreciate any input here, this isn't something I'd like to learn that I'd done wrong the hard way.