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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ECommerceEvent
addCartItemEvent
(ECommerceCartItem cartItem) Creates e-commerce AddCartItemEvent.static ECommerceEvent
beginCheckoutEvent
(ECommerceOrder order) Creates e-commerce BeginCheckoutEvent.static ECommerceEvent
purchaseEvent
(ECommerceOrder order) Creates e-commerce PurchaseEvent.static ECommerceEvent
removeCartItemEvent
(ECommerceCartItem cartItem) Creates e-commerce RemoveCartItemEvent.static ECommerceEvent
showProductCardEvent
(ECommerceProduct product, ECommerceScreen screen) Creates e-commerce ShowProductCardEvent.static ECommerceEvent
showProductDetailsEvent
(ECommerceProduct product, ECommerceReferrer referrer) Creates e-commerce ShowProductDetailsEvent.static ECommerceEvent
showScreenEvent
(ECommerceScreen screen) Creates e-commerce ShowScreenEvent.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.appmetrica.analytics.impl.ecommerce.client.model.ProtoSerializable
toProto
-
Constructor Details
-
ECommerceEvent
protected ECommerceEvent()Constructor forECommerceEvent
-
-
Method Details
-
showScreenEvent
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
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
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
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
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
- Returns:
String
with event description
-