Unity Analytics 和欧盟一般数据保护条例 (GDPR)
Analytics 指标、细分段和术语

Unity Analytics DataPrivacy API

The DataPrivacy class configures the Unity Analytics service based on the player’s data privacy management choices.

NAMESPACE: UnityEngine.Analytics

    public class DataPrivacy 

The DataPrivacy class automatically fetches the player’s data privacy status and configures the Analytics service accordingly.

使用 FetchPrivacyUrl() 函数来获取玩家个人数据管理页面的 URL。打开该 URL 即可为玩家提供管理其数据隐私设置的选项。

This page details the following functions:

Initialize()

准备 Data Privacy API 以供使用。

Declaration

    public static void Initialize() 

详细信息

This function creates a hidden GameObject and adds an instance of the DataPrivacy class to it as a component.

On Unity 5.1 or earlier, call Initialize() early in your application startup (ideally, right after you call UnityAnalytics.StartSDK (projectId). Newer versions of Unity call Initialize() automatically.

FetchPrivacyUrl(Action<String>, Action<String>)

获取玩家个人数据管理页面的 URL。

Declaration

    public static void FetchPrivacyUrl(Action<string> success, Action<string> failure = null) 

Parameters

  • Action<String> success — 成功检索到该 URL 时要调用的 Action 对象。传递给 Action 的字符串包含该 URL。

  • [optional] Action<String> failure — Unity 无法检索该 URL 时要调用的 Action 对象。传递给 Action 的字符串包含失败原因。

详细信息

Open the URL passed to your success function in a browser or webview to give the player the opportunity to manage their data protection options. You can use Application.OpenURL() to open the page.

该 URL 在短时间内有效。务必在打开 URL 之前即时获取 URL。


  • 2018–11–05 Page published with limited editorial review

  • Removed Editor menu command for inserting the Data Privacy button. Added the Data Privacy Button prefab.

  • New feature in Unity 2018.1.

  • Removed FetchOptOutStatus function in 2018.3.

Unity Analytics 和欧盟一般数据保护条例 (GDPR)
Analytics 指标、细分段和术语