Skip to content

[Question] Analytics nested parameters #355

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

Closed
VolodymyrBS opened this issue Jun 14, 2022 · 5 comments
Closed

[Question] Analytics nested parameters #355

VolodymyrBS opened this issue Jun 14, 2022 · 5 comments

Comments

@VolodymyrBS
Copy link

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2020.3.34f1
  • Firebase Unity SDK version:
  • Source you installed the SDK: .unitypackage
  • Problematic Firebase Component: Analytica
  • Other Firebase Components in use: None
  • Additional SDKs you are using: None
  • Platform you are using the Unity editor on: Windows
  • Platform you are targeting: iOS, Android
  • Scripting Runtime: IL2CPP
  • Pre-built SDK from the website or open-source from this repo: website

[REQUIRED] Please describe the question here:

Hi!
I found this article that shows how to log list of dictionaries in swift and other languages
measure-ecommerce
But can not find a way how to do something similar in Unity.
so my question is it possible with Unity? or unity stuck with flat list of properties without any kind on nesting?

@paulinon
Copy link
Contributor

Hi @VolodymyrBS,

It's possible to do this in Unity by creating an array of parameters as seen here. You may refer to this page for the list of available parameter properties.

I'll be closing this for now. Let me know if an issue arises.

@VolodymyrBS VolodymyrBS changed the title [Question] [Question] Analytics nested parameters Jun 15, 2022
@VolodymyrBS
Copy link
Author

VolodymyrBS commented Jun 15, 2022

Hi @paulinon
thanks for your answer. but I am not sure I get how to do the same in Unity.
for instance, in swift the itemList from the first example ends up like this:

var jeggings: [String: Any] = []
var boots: [String: Any] = []
var socks : [String: Any] = []

var itemList: [String: Any] = [
  AnalyticsParameterItemListID: "L001",
  AnalyticsParameterItemListName: "Related products",
  AnalyticsParameterItems: [jeggings, boots, socks]
]

jeggings, boots, and socks by themselves are [String: Any]

so the analog in Unity would be

Parameter[] jeggings = {...};
Parameter[] boots = {...};
Parameter[] socks = {...};
Parameter[] AchievementParameters = {
    new Parameter(FirebaseAnalytics.ParameterItemListID, "L001"),
    new Parameter(FirebaseAnalytics.ParameterItemListName, "Related products"),
    new Parameter(FirebaseAnalytics.ParameterItemItems, new [] { jeggings, boots, socks }),
}

am I missing some way to put an array of Parameter into Parameter?

@VolodymyrBS
Copy link
Author

VolodymyrBS commented Jun 15, 2022

also, it looks like an example for ParameterItems on the page you provided does not use C#. I guess, it is Objective-C (because of NSArray)

@paulinon
Copy link
Contributor

Thanks for the clarification, @VolodymyrBS. In terms of ParameterItems, the team is currently still working on this feature. You may refer to the thread for updates.

@VolodymyrBS
Copy link
Author

Thanks for the clarification, @VolodymyrBS. In terms of ParameterItems, the team is currently still working on this feature. You may refer to the thread for updates.

thanks a lot!

@firebase firebase locked and limited conversation to collaborators Jul 16, 2022
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

2 participants