docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ConsentTracker

    Inheritance
    object
    ConsentTracker
    Implements
    IConsentTracker
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.Services.Analytics.Internal
    Assembly: solution.dll
    Syntax
    public class ConsentTracker : IConsentTracker

    Constructors

    Name Description
    ConsentTracker()

    Properties

    Name Description
    requiredHeaders

    Returns the required headers, based on the required legislation. If PIPL is not required it will return an empty Dictionary. In order to get the correct information, CheckGeoIP method has to be called beforehand (which updates the geolocation response for the current session).

    Methods

    Name Description
    BeginOptOutProcess()

    Begins the process of opting out from the current legislation. It sets the consent status for the specified legislation identifier to Forgetting and saves it in Player Preferences. In case of PIPL, the opt-in-based legislation, it will do nothing if the consent was not explicitly given beforehand. In order to deny the consent immediately, use SetUserConsentStatus(string identifier, bool consentGiven)

    BeginOptOutProcess(string)

    Begins the process of opting out for the specified legislation. It sets the consent status for the specified legislation identifier to Forgetting and saves it in Player Preferences. It includes the validation of the specified legislation. It requires CheckGeoIP method to be called before calling this method. In case of PIPL, the opt-in-based legislation, it will do nothing if the consent was not explicitly given beforehand, as the opting-out process includes sending the ForgetMe event to the backend. In order to deny the consent immediately, use SetUserConsentStatus(string identifier, bool consentGiven)

    If PIPL legislation is required and the specified legislation identifier is not PIPL, or the other legislation is required, but the specified legislation identifier is PIPL, ConsentCheckException is thrown.

    CheckGeoIP()

    Triggers the GeoIP call, if no geolocation data was already stored for this session, otherwise returns the last GeoIP response. Updates the consent status of PIPL legislation to reflect the current requirements (if it was previously set as Unknown, Not Required or Required But Unchecked) If the consent was already denied/given, but PIPL is not required anymore, the status is not changed.

    ConsentCheckException is thrown if the GeoIP call was unsuccessful.

    FinishOptOutProcess()

    Finishes the opting out process, whichever was triggered before. If both consent statuses were set to Forgetting (most likely due to technical problems), it will update both statuses to OptedOut.

    IsConsentDenied()

    Checks if the consent was denied or the user already opted-out.

    If the required legislation is PIPL, it takes priority over any other legislation. Even if the user did not opt out from CCPA/GDPR/etc, but denied consent for PIPL, this method will return true. If PIPL is not required, the method does not take into account PIPL consent status. It requires CheckGeoIP method to be called beforehand.

    If the user already started the process of opting out, but it wasn't finished yet, the method will return false.

    IsConsentGiven()

    Checks if the consent was given. If the required legislation is PIPL, it takes priority over any other legislation. Even if the user opted out from CCPA/GDPR/etc, but gave consent for PIPL, this method will return true. If PIPL is not required, the method does not take into account PIPL consent status. It requires CheckGeoIP method to be called beforehand.

    IsConsentGiven(string)

    Checks if the consent was given for the specified legislation (either explicitly given for PIPL or Unknown for opt-out flag). This method does not take into account the geolocation.

    As we currently do not store opt-out-based legislation as separate flags, if the identifier is not PIPL, the method checks the opt-out consent flag.

    IsGeoIpChecked()

    Checks whether the GeoIP response is already stored, which indicates that CheckGeoIP has been successfully called.

    IsOptingOutInProgress()

    Checks whether the opting out process already started for any legislation, regardless of the geolocation response.

    SetDenyConsentToAll()

    Sets opt-out-based consent flag to OptedOut and PIPL flag to either ConsentDenied or OptedOut - depending if the consent was previously given.

    SetUserConsentStatus(string, bool)

    Sets the consent status for the specified legislation identifier and saves it in Player Preferences. At the moment, it only works for PIPL (as every other legislation we track is opt-out based only, so we do not need to track whether the consent was explicitly given, and other legislation statuses are not separately stored).

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)