logAddToWishlist method

Future<void> logAddToWishlist({
  1. required String itemId,
  2. required String itemName,
  3. required String itemCategory,
  4. required int quantity,
  5. double? price,
  6. double? value,
  7. String? currency,
  8. String? itemLocationId,
})

Logs the standard add_to_wishlist event.

This event signifies that an item was added to a wishlist. Use this event to identify popular gift items in your app. Note: If you supply the value parameter, you must also supply the currency parameter so that revenue metrics can be computed accurately.

See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#ADD_TO_WISHLIST

Implementation

Future<void> logAddToWishlist({
  required String itemId,
  required String itemName,
  required String itemCategory,
  required int quantity,
  double? price,
  double? value,
  String? currency,
  String? itemLocationId,
}) {
  _requireValueAndCurrencyTogether(value, currency);

  return logEvent(
    name: 'add_to_wishlist',
    parameters: filterOutNulls(<String, Object?>{
      _ITEM_ID: itemId,
      _ITEM_NAME: itemName,
      _ITEM_CATEGORY: itemCategory,
      _QUANTITY: quantity,
      _PRICE: price,
      _VALUE: value,
      _CURRENCY: currency,
      _ITEM_LOCATION_ID: itemLocationId,
    }),
  );
}