Unity Analytics but for GameMaker
- Register a Unity services account and create an analytics project.
- Obtain the project ID (a hexadecimal string) and environment ID (usually "production").
- Import the Unity Analytics .yymps into your project.
- Open
__UAConfig
and adjustUA_PROJECT_ID
andUA_ENVIRONMENT_ID
. - Execute the following code on boot:
UASetUserID(UAEnsureUserID("analyticsUserID.dat")); UASetUserConsent(true);
- Run your game on Windows, MacOS, or Linux. The library will automatically send a "gameStarted" event to UA.
- Wait 5 minutes then check the Unity Analytics event browser. You should see a valid "gameStarted" event appear.
- Define some custom events in the UA backend. Call
UAEvent()
in your code to match these custom events. - Set
UA_DEBUG_LEVEL
to 1 or 2 to help with debugging. Run the game and check events are being triggered properly. - Wait 5 minutes then check the event browser to confirm your custom events have been received.
- Remove the
UASetUserConsent()
call on boot and build a user consent flow for analytics in your game.
And you're done! Please read comments in the library's functions (there aren't many) to learn about advanced use. This library should work on every platform that allows outgoing HTTP requests but has only been tested on desktop and mobile.