Class ECommerceEvent

java.lang.Object
io.appmetrica.analytics.ecommerce.ECommerceEvent
All Implemented Interfaces:
io.appmetrica.analytics.impl.ecommerce.client.model.ProtoSerializable

public abstract class ECommerceEvent extends Object implements io.appmetrica.analytics.impl.ecommerce.client.model.ProtoSerializable
ECommerce event object. Use static methods of this class to form e-commerce event. There are several different types of e-commerce events for different user actions. Each method corresponds to one specific type. See method descriptions for more info.
  • Constructor Details

    • ECommerceEvent

      protected ECommerceEvent()
      Constructor for ECommerceEvent
  • Method Details

    • showScreenEvent

      @NonNull public static ECommerceEvent showScreenEvent(@NonNull ECommerceScreen screen)
      Creates e-commerce ShowScreenEvent. Use this event to report user opening some page: product list, search screen, main page, etc.
      Parameters:
      screen - Screen that has been opened.
      Returns:
      e-commerce ShowScreenEvent
      See Also:
    • showProductCardEvent

      @NonNull public static ECommerceEvent showProductCardEvent(@NonNull ECommerceProduct product, @NonNull ECommerceScreen screen)
      Creates e-commerce ShowProductCardEvent. Use this event to report user viewing product card among others in a list. Best practise is to consider product card viewed if it has been shown on screen for more than N seconds.
      Parameters:
      product - Product that has been viewed.
      screen - Screen where the product is shown.
      Returns:
      e-commerce ShowProductCardEvent
      See Also:
    • showProductDetailsEvent

      @NonNull public static ECommerceEvent showProductDetailsEvent(@NonNull ECommerceProduct product, @Nullable ECommerceReferrer referrer)
      Creates e-commerce ShowProductDetailsEvent. Use this method to report user viewing product card by opening its own page.
      Parameters:
      product - Product that has been viewed.
      referrer - Info about the source of transition to shown product card.
      Returns:
      e-commerce ShowProductDetailsEvent
      See Also:
    • addCartItemEvent

      @NonNull public static ECommerceEvent addCartItemEvent(@NonNull ECommerceCartItem cartItem)
      Creates e-commerce AddCartItemEvent. Use this method to report user adding an item to cart.
      Parameters:
      cartItem - Item that has been added to cart.
      Returns:
      e-commerce AddCartItemEvent
      See Also:
    • removeCartItemEvent

      @NonNull public static ECommerceEvent removeCartItemEvent(@NonNull ECommerceCartItem cartItem)
      Creates e-commerce RemoveCartItemEvent. Use this method to report user removing an item form cart.
      Parameters:
      cartItem - Item that has been removed from cart.
      Returns:
      e-commerce RemoveCartItemEvent
      See Also:
    • beginCheckoutEvent

      @NonNull public static ECommerceEvent beginCheckoutEvent(@NonNull ECommerceOrder order)
      Creates e-commerce BeginCheckoutEvent. Use this event to report user begin checkout a purchase.
      Parameters:
      order - Various info about purchase.
      Returns:
      e-commerce BeginCheckoutEvent
      See Also:
    • purchaseEvent

      @NonNull public static ECommerceEvent purchaseEvent(@NonNull ECommerceOrder order)
      Creates e-commerce PurchaseEvent. Use this event to report user complete a purchase.
      Parameters:
      order - Various info about purchase.
      Returns:
      e-commerce PurchaseEvent
      See Also:
    • getPublicDescription

      @NonNull public String getPublicDescription()
      Returns:
      String with event description