Firebase dashboard doesn't show price in top products

不羁岁月 提交于 2021-01-28 07:43:30

问题


In the Firebase dashboard, when looking at the add_to_cart event, I can see the price parameter firing with values succesfully:

But then below, in the "top products" window, I cannot see any prices:

I'm trying to understand why. Is it because I'm not sending the value parameter (I'm only sending the price and currency) Thanks


回答1:


The events summary in your first screenshot shows the price parameter sent. This could be a string, a number, anything. In your case it's a number.

The products summary in your second screenshot shows the value parameter sent. This must be a monetary value, and is what you should be using.

From the docs:

public static final String VALUE

A context-specific numeric value which is accumulated automatically for each event type. Value should be specified with putLong(String, long) or putDouble(String, double). This is a general purpose parameter that is useful for accumulating a key metric that pertains to an event. Examples include revenue, distance, time, and points. Notes: Values for pre-defined currency-related events (such as ADD_TO_CART) should be accompanied by a CURRENCY param. The valid range of accumulated values is [-9,223,372,036,854.77, 9,223,372,036,854.77]. Supplying a non-numeric value, omitting the corresponding CURRENCY parameter, or supplying an invalid currency code for conversion events will cause that conversion to be omitted from reporting.

 Bundle params = new Bundle();
 params.putDouble(Param.VALUE, 3.99);
 params.putString(Param.CURRENCY, "USD" );  // e.g. $3.99 USD


来源:https://stackoverflow.com/questions/58072752/firebase-dashboard-doesnt-show-price-in-top-products

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!