问题
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)
orputDouble(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 aCURRENCY
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 correspondingCURRENCY
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