Use
There are a ton of events that are tracked automatically. To see a full list, check out the Default Events
If you want to track a custom event, you need to:
var analyticsManager = AnalyticsManager.Instance;
var eventData = new Dictionary<string, object>();
eventData.Add("remaining_lives", 2)
analyticsManager.TrackCustomEvent("LostLife", eventData);
For Garbage Collection purposes, if you are sending an event frequently, make sure you recicle the dictionary, and not create a new one every single time you call TrackCustomEvent.
AnalyticsManager _analyticsManager;
Dictionary<string, object>() _eventData = new Dictionary<string, object>();
void Start()
{
_analyticsManager = AnalyticsManager.Instance;
}
void FrequentlyCalledMethod()
{
_eventData.Clear();
_eventData.Add("remaining_lives", 2)
_analyticsManager.TrackCustomEvent("LostLife", _eventData);
}