quickstart-unity
quickstart-unity copied to clipboard
Firebase Analytics: Event Parameter Requires "NSArray" but C# Parameter Class Doesn't Support NSArray
Please fill in the following fields:
Unity editor version: 2019.3.0f6 Firebase Unity SDK version: 6.12.0 Source you installed the SDK (.unitypackage or Unity Package Manager): .unitypackage Firebase plugins in use (Auth, Database, etc.): Auth, Analytics, Functions, Crashlytics Additional SDKs you are using (Facebook, AdMob, etc.): Facebook Platform you are using the Unity editor on (Mac, Windows, or Linux): Windows Platform you are targeting (iOS, Android, and/or desktop): iOS, Android, WebGL Scripting Runtime (Mono, and/or IL2CPP): IL2CPP
Please describe the issue here:
(Please list the full steps to reproduce the issue. Include device logs, Unity logs, and stack traces if available.)
Using Firebase Analytics, submit the event EventAddToCart with the parameter ParameterItems. Notice the Unity Documentation says ParameterItems should be of type (NSArray). Notice Parameter does not accept Arrays and only accepts string, long, and double.
Please answer the following, if applicable:
Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)? No
What's the issue repro rate? (eg 100%, 1/5 etc) 100%
Thanks for the report!
To be extra clear, here's the analytics call in JavaScript:
firebase.analytics().logEvent("view_item",
{
currency: "someCurrencyName",
value: 12,
items: [{item_id: "someID"}]
}
);
Notice in Javascript that the "items" event parameter is an array of Item objects. And here's the same call from Unity:
Parameter[] parameters = {
new Parameter(FirebaseAnalytics.ParameterCurrency, "someCurrencyName"),
new Parameter(FirebaseAnalytics.ParameterValue, 12),
new Parameter(FirebaseAnalytics.ParameterItems, "") //How do you specify items?
};
FirebaseAnalytics.LogEvent("view_item", parameters);
Notice that in Unity it's impossible to specify the Item objects for the "items" event parameter. The Unity Parameter class only accepts: double, long, and string.
This means that a cross platform application running in both Unity and Javascript are incapable of logging identical analytics events. Unity is incapable of logging events that follow the Google Analytics specification.
Further: The documentation under the Unity Documentation for Event Parameters is written in Objective-C. For example: ParameterItems mentions "NSArray" and uses the Objective-C "@" operator. This appears to be a copy and paste error and further adds to confusion.
Do you have any update or workaround for this? Thanks.
Any update on this?
well we really need this
This is fundamental also to be able to implement the "begin_checkout" and "purchase" events
is there any information regarding this? this issue is 2 years old and still no news 😢
well what is there?
@paulinon @patm1987 do you have any news about it? why is this taking so long to do under C#/Unity. Isn't that the priority you should be focusing on?
kill me, we are tired of waiting
@paulinon @patm1987 So what are we supposed to do? What a basic thing yet not supported in Unity... That's unbelievable.
Just ran into this and there still doesn't seem to be anyway to do this in 2024...? :(
@patm1987 - Any chance this can be priortised somehow?