I am a little confuse about what I have to use. I am sure this topic has been discussed in the past but I couldn’t find additional information.
Unity Analytics:
- Built-in package
- com.unity.modules.unityanalytics
- Unity - Manual: Unity Analytics
Analytics:
- Unity Package
- com.unity.services.analytics
- Unity Analytics
I think I have to use the second one, but, in that case, what is the first one? Can I safety disabled it?
I am having these doubts because every time I try some code, it doesn’t even compile, and I don’t know if it is because I am using the wrong package, the wrong version, or maybe something else.
P.S:
I am currently trying the latest Analytics (com.unity.services.analytics | 6.0.2), and this code found in Unity Learn doesn’t work (Record user actions with Analytics events - Unity Learn)
private void LevelCompletedCustomEvent()
{
int currentLevel = Random.Range(1, 4); // Gets a random number from 1-3
// Define Custom Parameters
Dictionary<string, object> parameters = new Dictionary<string, object>()
{
{ "levelName", "level" + currentLevel.ToString()}
};
// The ‘levelCompleted’ event will get cached locally
//and sent during the next scheduled upload, within 1 minute
AnalyticsService.Instance.CustomData("levelCompleted", parameters);
// You can call Events.Flush() to send the event immediately
AnalyticsService.Instance.Flush();
}
I assume that the problem is that the API has changed, but in the official documentation, Unity Analytics, you can not change the version to see API changes, as you can in netcode, for instance (About Netcode for GameObjects | Unity Multiplayer)
So it is difficult to really follow what to use and how to use it.
Thanks