Version: 2021.3
LanguageEnglish
  • C#

Analytics

class in UnityEngine.Analytics

/

Implemented in:UnityEngine.UnityAnalyticsModule

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Unity Analytics provides insight into your game users e.g. DAU, MAU.

Note: The documentation that follows is for usage of Unity Analytics with Unity 5.1 and above. To integrate Unity Analytics with earlier versions of Unity, refer to the documentation at https://analytics.cloud.unity3d.com/docs

Specifically, out-of-the-box features include access to user engagement and retention data through Metric Monitor and Data Explorer. Segmentation of players across various user dimensions and characteristics is automatically applied, with more than 20 standard segments available without any additional instrumentation.

For more detail around features, refer to the Unity Analytics homepage at http://unity3d.com/unity/analytics.

Important: Always make calls to the Analytics API inside the scope of an #if ENABLE_CLOUD_SERVICES_ANALYTICS statement to prevent compilation errors on platforms that do not support Analytics:

#if ENABLE_CLOUD_SERVICES_ANALYTICS
// Analytics code
#endif

Static Properties

configUrlGet the Analytics config endpoint.
dashboardUrlGet the Analytics dashboard endpoint.
deviceStatsEnabledControls whether the sending of device stats at runtime is enabled.
enabledControls whether the Analytics service is enabled at runtime.
eventUrlGet the Analytics event endpoint.
initializeOnStartupReports whether Unity is set to initialize Analytics on startup.
limitUserTrackingControls whether to limit user tracking at runtime.
playerOptedOutReports whether the player has opted out of data collection.

Static Methods

CustomEventCustom Events (optional).
EnableCustomEventUse it to enable or disable a custom event.
EnableEventUse it to enable or disable an event.
FlushEventsAttempts to flush immediately all queued analytics events to the network and filesystem cache if possible (optional).
IsCustomEventEnabledUse it to check to custom event enable status.
IsEventEnabledUse it to check to an event enable status.
RegisterEventThis API is used for registering a Runtime Analytics event. Note: This API is for internal use only and is likely change in the future. Do not use in user code.
ResumeInitializationResume Analytics initialization.
SendEventThis API is used to send a Runtime Analytics event. Note: This API is for internal use only and is likely change in the future. Do not use in user code.
SetEventEndPointUse this API to set the event end point URL. Note: This API is for internal use only and is likely change in the future. Do not use in user code.
SetEventPriorityUse this API to set the event priority. Note: This API is for internal use only and is likely change in the future. Do not use in user code.
TransactionTracking Monetization (optional).
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961