Hi, I was using the new Analytics package and I realized after hours of debugging that floating numbers are not correctly serialized when sending custom events from Unity. I have rounded the float to int (without even changing the schema in the dashboard to be still a float) and it works perfectly. Just try to send a custom event with a float/double parameter, and Unity will tell you this:
Incorrect response, check your JSON for errors.
Events failed to upload (code 400) – will retry at next heartbeat.
Just to update you: we verified this is a bug with the SDK.
Our teams will pick this up with urgency and we’ll update you as and when there’s a change.
We’ll update you as appropriate and when there’s a solution for you.
Sorry for the delay on this one, I’ve had a look at this but was unable to reproduce it locally. Could you confirm whether this is still an issue? If so I’ll have to look a bit further.
My initial thought was that the system locale may be set to Spanish where it’s apparently conventional to use a comma for a decimal separator rather than a dot but when I tested this locally on macOS I was unable to reproduce this after setting my locale to Spain (internally we use StringBuilder to convert the Analytics data into Json, it appears to handle these kinds of locale discrepancies as expected at least).
Please let me know if this is still an issue for you with the latest Analytics package or if we can close this bug
Quick update, just saw a different report come in that confirmed my suspicion, I’ll be having a look at this bug today, should be easy enough to fix once I’m able to reproduce it
If it helps, I had the same problem (operating system in french if its a problem of parsing float with different culture) : all custom events containing a float parameter didnt appear in Event Browser neither in valid/invalid tab.
Once I cast the value as integer in game and changed the parameter type to integer, those events appeared in the Event Browser
Good news :), I was able to fix this issue this morning and it will be going out with the next release of Analytics. I don’t yet have any ETA on when it will be released but shouldn’t be too long I presume.
This bug is still present in Analytics 5.0 with Unity 2020.3.44. My localization is ES-es, and floats just don’t work; I wasted a full day thinking it was my mistake and reconfiguring events and parameters…