GameAnalytics||doc136727

September 20, 2022

GameAnalytics

Global singleton

Must passEngine.GameAnalyticsvisit

Brief Introduction

Gameanalytics is a service that records certain behaviors in games. In the process of game development, developers can implant code into key points of the game to record player behavior. Track player behavior through statistics, analyze player behavior, and optimize and improve the player's game experience. For example, record the purchase times of certain props, the number of people who pass each level, and the use of new functions, so as to analyze whether the props are popular, the difficulty of the level, and the acceptance of new functions, and judge whether the game needs to be adjusted through this data.

Function

void ReportDatastring behavior, stringexplain,Entity player )
Report data. The entity object to be reported must be a player

Code example

It is reported when players buy props. It is used to count the number of times players buy different props and analyze which props players prefer.

--- The logic for handling the purchase of props is omitted here
--- player is the player who purchased the item
--- itemName is the name of the item

Engine.GameAnalytics:ReportData("BuyItem", itemName, player)