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 - sending nested object as event log #563

Open
GFean opened this issue Apr 2, 2021 · 1 comment
Open

Firebase Analytics - sending nested object as event log #563

GFean opened this issue Apr 2, 2021 · 1 comment

Comments

@GFean
Copy link

GFean commented Apr 2, 2021

Hi there, I'm using firebase analytics for my app. The goal I'm trying to achieve is to log several informations about the user, which are located in different DTOs. For example if user clicks removeProductFromCart button, I want to log which product that was and this is another DTO, if user clicks clearCart, I want to log the list of the objects that were contained in the cart before..
I hope I explained it in an understandable way. So the result must look something like this :
analytics().logEvent('remove_from_cart', {product: {id: 123, name:"test" ...} userInfo: {id: 123, userName: "test" ...} })
But when I do following, it seems to be working - since it doesn't give any errors, but it appears as firebase_error 21 in firebase console. Is this approach not supported ? does any other approach exist for achieving the same goal ?
Thanks in advance !

@renamoo
Copy link

renamoo commented Jun 8, 2021

According to the doc, firebase_error 21 looks like the error code indicating Event does not support array parameters. So if you get this error, I guess that field does not support the type you set.

Maybe you can use items field to store items in the cart? It accepts Array.
https://developers.google.com/gtagjs/reference/event#parameters_19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants