Is there a way to just send an event with an int? it seems I can only send dictionaries

Hi,

I’m trying to wrap my head around these new analytics. right now I’m using Analytics.CustomEvent for any custom analytics I want to send. But it only accepts an int. For example I want to send the number of levels completed in a session. something like levelsCompletedInSession = 2. Do I have to create a dict just to send this?

you can check my post here : although Unity at the moment seems having some problem displaying the data

Not sure I understood. what I’m saying is that it seems Analytics.CustomEvent only receives an event name and a dict. I just want to send an event name and an int.

Hi humanMusic,

As of v5.1.0 of the Analytics SDK, you can use the new generic CustomEvent Class without needing to create a Dictionary.

CustomEvent myEvent = new CustomEvent("MyEvent")
{
    { "fabulousString", "woah!" },
    { "peculiarBool", true },
    { "sparklingInt", 1337 },
    { "spectacularFloat", 313.37f }
};
AnalyticsService.Instance.RecordEvent(myEvent);

Check out the Analytics Samples that can be downloaded from the Package Manager for more examples of Analytics use cases.