Search code examples
swiftfirebasefirebase-analyticsgoogle-analytics-4google-analytics-firebase

How to verify Firebase Item-scoped custom parameter are correctly sent on the console?


I'm using Firebase iOS SDK version 10.7.0 to send item-scoped custom parameter while logging some ecommerce events as it's a feature that was added on version 10.6.0.

The feature doesn't seem to be very well documented, but I'm assuming that sending an item-scoped custom parameter would be the same as sending an event-scoped custom parameter.

The only thing I had to do to send event-scoped custom parameter was to add a new custom key in the logEvent parameters dictionary with some value.

let params = [
"some_custom_key": "someValue"
]
Analytics.logEvent(AnalyticsEventAddToCart, parameters: params)

So my assumption was that in order to add an item-scoped custom parameter I had to add a custom key to the item dictionary that was sent in the items array.

Something along those lines:

let params = [
AnalyticsParameterItems: [[
     AnalyticsParameterItemID: "someID",
     AnalyticsParameterItemCategory: "someCategory",
     AnalyticsParameterItemName: "someName",
     AnalyticsParameterQuantity: 1,
     AnalyticsParameterItemBrand: "someBrand",
     AnalyticsParameterItemVariant: "someVariant"
     "param_item_custom_id": "someCustomId", // This one being the custom parameter
  ]]
]
Analytics.logEvent(AnalyticsEventAddToCart, parameters: params)

But I can't seem to find a way to verify that my implementation was correct on the console as nothing changes on the Debug View and nothing returns from the queries in the explorer tab.

When I run my debug view I see the events and the items, but nothing about the custom item-scoped parameters.

Debug View with items without custom parameters

I've also tried to add a custom dimension with the same name and item scoped (although that was not needed for event-scoped custom parameters) but that did nothing.

Item-Scoped Custom Dimention

I've also waited the suggested 48 hours and the item still doesn't show neither in debug view nor in the explore tab where it always appear as (not set).

Explore tab


All of that said, I really doubt that the feature is out before it can be verified on the console. So I'm probably missing something and there's a mistake somewhere either in the way I'm sending the custom parameters or in the way I'm validating those parameters in the console.

Do you guys know where to send the item-scoped custom parameter and where can I validate that my implementation is correct on the Firebase console?


Solution

  • Have the same issue. Can't see any custom Item-scoped parameters in the Debug View "Items" tab, only predefined ones, such as: item_id, item_name, etc...

    Have decided to write to Firebase Support recently. This is the part of the answer I got:

    Upon checking with our experts, it looks like we have been receiving similar reports from other developers about some e-commerce events that are unable to display the item-scoped custom parameter in DebugView. Just to give you an insight, we've raised this issue to our engineers for investigation and as an action, I've added your case as another instance of this bug report. Though, I can't guarantee any details or timeline on when this issue will be fixed as I don't have visibility on the roadmap. For now, you may keep an eye out on our official blog, release notes, or Firebase console for the latest updates and fixes that we may have. Additionally, this parameter is technically being sent and processed in our backend servers. It is just that DebugView couldn’t display this, but if you will check the application's debug logs, you’ll see that this is being sent by our SDK from your application to our servers.

    Also, there is a tool for debugging Firebase Analytics I have tried - https://www.analytics-debugger.com/tools/ios-android-debugger/

    Using this tool I was finally able to see custom Item parameters in the "items" array. But, of course, maybe it would be better to see them in the Debug View :)