-
Notifications
You must be signed in to change notification settings - Fork 41
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
Fix - Change Product Clicked method on firebase_plugin #91
Conversation
hey @edsonjab, how are you? Thanks to invest you time and effort on this issue =) I would like to double check with you some points 1 - If the user was in a list, we will trigger the 2 - if the user clicks a product, to keep the correct tracking, we should also send the if we do not send it, I think we will lose track of which list creates the best interaction =( so, I think the flow in the end will be something like this 1 - send the analytics.track('Product List Viewed', properties: {
"list_id": 'hot_deals_1',
"category": 'Deals',
"products": [
{
"product_id": '507f1f77bcf86cd799439011',
"sku": '45790-32',
"name": 'Monopoly: 3rd Edition',
"price": 19,
"position": 1,
"category": 'Games',
"url": 'https://www.example.com/product/path',
"image_url": 'https://www.example.com/product/path.jpg'
},
{
"product_id": '505bd76785ebb509fc183733',
"sku": '46493-32',
"name": 'Uno Card Game',
"price": 3,
"position": 2,
"category": 'Games'
}
]
}); 2 - Send the analytics.track('Product Clicked', properties: {
"list_id": 'hot_deals_1',
"list_name": 'Hot Deals Toys'
"product_id": '507f1f77bcf86cd799439011',
"sku": 'G-32',
"category": 'Games',
"name": 'Monopoly: 3rd Edition',
"brand": 'Hasbro',
"variant": '200 pieces',
"price": 18.99,
"quantity": 1,
"coupon": 'MAYDEALS',
"position": 3,
"url": 'https://www.example.com/product/path',
"image_url": 'https://www.example.com/product/path.jpg'
}); which should be translated to case 'Product Clicked':
if (properties.containsKey('list_id') ||
properties.containsKey('list_name') ||
properties.containsKey('name') ||
properties.containsKey('itemId')) {
throw Exception("Missing properties: list_name, list_id, name and itemID");
}
// should we create the item object ?
AnalyticsEventItem t = AnalyticsEventItem(itemName: properties['name'].toString(), itemId: properties['itemId'].toString());
await FirebaseAnalytics.instance.logSelectItem(
itemListName: properties['list_name'].toString(),
itemListId: properties['list_id'].toString(),
item:[clickedItem],
);
break; I am not sure, havent tested it yet, but do you know if we need to create the complete object for the thanks for the help |
Hi @fhdeodato I got your idea, According to firebase method Maybe the confusion is because both methods In your example you use |
Hey @edsonjab thanks for the feedback
Sure, I just used that as an example to get the navigation flow idea, first the
but as I understood from Firebase they have the same name because they will have the same value, this is not the product name or product id but the information that Firebase will use to track that the item clicked was inside of list 'X'. that is why I think from the segment event we are missing information to keep propagating the list id and name to Firebase.
Sorry for that, I have just copied the example from here
Totally agree here, but if I have the information it is nice to send and get the most complete data possible =) My point is, if we send out the because following the Firebase documentation for we have the description for
and I also think we can add multiples items because, in some cases, user check check all the product and perform some actions Really nice that you take time to help the community with that... thanks once again. |
hi @fhdeodato, so sorry for the confusion, I understand your idea.
I will implement your solution, is better to add the Item values to track the event. |
Hey @edsonjab thanks for the update =) just one comment =) I think we need to change the validation for the parameters it is missing a so, should be like this
to validate id any of those parameters are missing =) Thanks a lot for this fix =) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change covers the correct event mapping and parameters
Fix issue #90