I am trying to report a VIEW_ITEM_LIST event with some ITEMS inside. Everything is reported properly in the Debug View except for the items. I am not using any custom event. It seems to happen the same problem in both Android and iOS.
Here is my code.
override fun trackListViewEvent() {
val eventBundle = Bundle().apply {
val itemBundle1 = Bundle().apply {
putString(Param.ITEM_NAME, "name1")
putString(Param.ITEM_CATEGORY, "Category")
putString(Param.PRICE, "49.95")
putString(Param.CURRENCY, "EUR")
}
val itemBundle2 = Bundle().apply {
putString(Param.ITEM_NAME, "name2")
putString(Param.ITEM_CATEGORY, "Category")
putString(Param.PRICE, "89.95")
putString(Param.CURRENCY, "EUR")
}
putString(Param.ITEM_LIST_ID, "1234567890")
putString(Param.ITEM_LIST_NAME, "WhateverListName")
putString(Param.PRICE, "125.60")
putString(Param.CURRENCY, "EUR")
putParcelableArray(Param.ITEMS, arrayOf(itemBundle1, itemBundle2))
}
tracking.logEvent(Event.VIEW_ITEM_LIST, eventBundle)
}
In the Logcat I get: W/FA-SVC: Param value can't be null: items
Another problem is that it seems that ITEMS only accepts some parameters. When adding custom parameters I get E/FA: Item cannot contain custom parameters
, but when adding NOT custom parameters like FLIGHT_NUMBER I get the same error. And I could not find any explanation on the documentation on which parameters are accepted.
Firebase says that it can take up to 24h hours, but the docs say that the dashboard updates "a few times every day".
Generally, events logged by your app are batched together over the period of approximately one hour and uploaded together.
You can see the device list in Firebase Analytics. In dashboard -> device model click in view device model. You can see list of all the devices with details.
In the Firebase console, open your project. Select Analytics from the menu to view the Analytics reporting dashboard. The Events tab shows the event reports that are automatically created for each distinct type of event logged by your app.
The example code from Google (link) written in Java, converts to this code in Kotlin
val item1 = Bundle()
item1.putString(FirebaseAnalytics.Param.ITEM_NAME, "jeggings")
item1.putString(FirebaseAnalytics.Param.ITEM_CATEGORY, "pants")
val item2 = Bundle()
item2.putString(FirebaseAnalytics.Param.ITEM_NAME, "boots")
item2.putString(FirebaseAnalytics.Param.ITEM_CATEGORY, "shoes")
parameters.putParcelableArray(FirebaseAnalytics.Param.ITEMS, arrayOf(item1, item2))
This does not work: on Emulator I got firebase error 25 and on a device it did not show at all in DebugView). You have to infer the Parcelable. So change the last line to below and you should be fine!
parameters.putParcelableArray(FirebaseAnalytics.Param.ITEMS, arrayOf<Parcelable>(item1, item2))
I've been working on this for some months so I can shed some light in case anyone is having similar problems:
Bundle().apply{ putParcelabelArray(Param.ITEMS, bundleList.toTypedArray()}
During this months some parameters and events have been deprecated. So you should constantly check if there are any changes. Keep in mind that firebase analytics for web + app will be released soon, maybe it's a good idea implementing directly web + app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With