Class ECommerceEvent

java.lang.Object
com.yandex.metrica.ecommerce.ECommerceEvent
All Implemented Interfaces:
com.yandex.metrica.impl.ecommerce.client.model.ProtoSerializable

public abstract class ECommerceEvent
extends java.lang.Object
implements com.yandex.metrica.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

      public 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:
      ECommerceScreen
    • 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:
      ECommerceProduct, ECommerceScreen
    • 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:
      ECommerceProduct, ECommerceReferrer
    • 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:
      ECommerceCartItem
    • 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:
      ECommerceCartItem
    • 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:
      ECommerceOrder
    • 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:
      ECommerceOrder
    • getPublicDescription

      @NonNull public java.lang.String getPublicDescription()