Set Item arraylist to firebase analytics event in ADD_TO_CART not working (Android)

Viewed 846

My code for add_to_cart in firebase event is as follows:

public void addToCartEvent(ArrayList<ServiceModel>items, String currency, Long value){
    ArrayList<Bundle> products = new ArrayList<>();
    for(int i=0;i<items.size();i++){
        Bundle product1 = new Bundle();
        product1.putString( FirebaseAnalytics.Param.ITEM_ID, String.valueOf(items.get(i).getId())); // ITEM_ID or ITEM_NAME is required
        product1.putString( FirebaseAnalytics.Param.ITEM_NAME, items.get(i).getName());
        product1.putString( FirebaseAnalytics.Param.ITEM_CATEGORY, "");
        product1.putDouble( FirebaseAnalytics.Param.PRICE, items.get(i).getRate() );
        product1.putString( FirebaseAnalytics.Param.CURRENCY, "INR" ); // Item-level currency unused today
        product1.putLong( FirebaseAnalytics.Param.QUANTITY, 1);
        products.add(product1);
    }
    Bundle params = new Bundle();
    String username = appPreferences.getString(AppPreferences.Keys.NAME);
    String email = appPreferences.getString(AppPreferences.Keys.EMAIL);
    String mobileNumber = appPreferences.getString(AppPreferences.Keys.MOBILE);
    params.putString("user_name", username);
    params.putString("email", email);
    params.putString("mobile_number", mobileNumber);
    params.putString(FirebaseAnalytics.Param.CURRENCY, currency);
    params.putDouble(FirebaseAnalytics.Param.VALUE, value);
    params.putParcelableArrayList(FirebaseAnalytics.Param.ITEMS,
            products);
    mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.ADD_TO_CART, params);

}

The problem is that i am not getting the list of items in firebase console. Please Help!

2 Answers

I noticed that you are unable to see ITEMS parameter in the Firebase console. Upon checking, there is an internal bug filed on firebase end regarding this issue. It’s expected that it will not show yet in the Firebase Console (DebugView, dashboard, etc.). However, this parameter can be seen in BigQuery, but it’s only supported for the Retail/Ecommerce events.

There is a tab named Items in debug view where you can see items

enter image description here

Related