Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firebase Analytics: Event Parameter Requires "NSArray" but C# Parameter Class Doesn't Support NSArray #713

Closed
doom-goober opened this issue Jun 16, 2020 · 14 comments

Comments

@doom-goober
Copy link

doom-goober commented Jun 16, 2020

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%

@doom-goober doom-goober added the new New issue. label Jun 16, 2020
@patm1987 patm1987 added type: bug and removed new New issue. labels Jun 18, 2020
@patm1987
Copy link

Thanks for the report!

@patm1987 patm1987 added needs-attention Need Googler's attention and removed needs-attention Need Googler's attention labels Jun 18, 2020
@doom-goober
Copy link
Author

doom-goober commented Jun 23, 2020

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.

@ishnu47
Copy link

ishnu47 commented Nov 11, 2020

Do you have any update or workaround for this?
Thanks.

@emaadgh
Copy link

emaadgh commented Nov 22, 2020

Any update on this?

@BukerBear
Copy link

well we really need this

@sdalexandre
Copy link

This is fundamental also to be able to implement the "begin_checkout" and "purchase" events

@VolodymyrBS
Copy link

VolodymyrBS commented Jun 16, 2022

is there any information regarding this?
this issue is 2 years old and still no news 😢

@ilsnk
Copy link

ilsnk commented Nov 18, 2022

well what is there?

@ilsnk
Copy link

ilsnk commented Nov 18, 2022

@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?

@ilsnk
Copy link

ilsnk commented Feb 6, 2023

kill me, we are tired of waiting

@JZechy
Copy link

JZechy commented Apr 26, 2023

@paulinon @patm1987 So what are we supposed to do? What a basic thing yet not supported in Unity... That's unbelievable.

@nindim
Copy link

nindim commented Jan 6, 2024

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?

@jack-gerrard
Copy link

I'm also in need of this!

@argzdev
Copy link
Contributor

argzdev commented Jul 8, 2024

Hi folks, for proper tracking, please continue updates on this thread to avoid duplicates. I'll go ahead and close this thread. We'll reply back to the linked thread as soon as we have updates to share. Thanks!

@argzdev argzdev closed this as completed Jul 8, 2024
@firebase firebase locked and limited conversation to collaborators Aug 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests