YMMECommerce class
Methods of this class create a YMMECommerce
instance.
For different user actions, there are appropriate types of E-commerce events. To create a specific event type, use the appropriate class method.
YMMECommerce
instance using the report(eCommerce:onFailure:) method of the YMMYandexMetrica class and the YMMYandexMetricaReporting protocol.Instance methods
showScreenEvent(screen:) | Creates an E-commerce event called |
showProductCardEvent(product:screen:) | Creates an E-commerce event called |
showProductDetailsEvent(product:referrer:) | Creates an E-commerce event called |
addCartItemEvent(cartItem:) | Creates an E-commerce event called |
removeCartItemEvent(cartItem:) | Creates an E-commerce event called |
beginCheckoutEvent(order:) | Creates an E-commerce event called |
purchaseEvent(order:) | Creates an E-commerce event called |
showScreenEvent(screen:) | Creates an E-commerce event called |
showProductCardEvent(product:screen:) | Creates an E-commerce event called |
showProductDetailsEvent(product:referrer:) | Creates an E-commerce event called |
addCartItemEvent(cartItem:) | Creates an E-commerce event called |
removeCartItemEvent(cartItem:) | Creates an E-commerce event called |
beginCheckoutEvent(order:) | Creates an E-commerce event called |
purchaseEvent(order:) | Creates an E-commerce event called |
Method descriptions
showScreenEvent(screen:)
static func showScreenEvent(screen: YMMECommerceScreen) -> YMMECommerce
Creates an E-commerce event called ShowScreenEvent
. Use it to report the opening of a page, such as a list of products, search or home page.
screen | The screen that was opened. The YMMECommerceScreen class instance. |
screen | The screen that was opened. The YMMECommerceScreen class instance. |
Returns:
The YMMECommerce
class instance.
showProductCardEvent(product:screen:)
static func showProductCardEvent(product: YMMECommerceProduct, screen: YMMECommerceScreen) -> YMMECommerce
Creates an E-commerce event called ShowProductCardEvent
. Use it to report viewing a product profile among others on the list.
product | The product that was shown. The YMMECommerceProduct class instance. |
screen | The screen where the product was displayed. The YMMECommerceScreen class instance. |
product | The product that was shown. The YMMECommerceProduct class instance. |
screen | The screen where the product was displayed. The YMMECommerceScreen class instance. |
Returns:
The YMMECommerce
class instance.
showProductDetailsEvent(product:referrer:)
static func showProductDetailsEvent(product: YMMECommerceProduct, referrer: YMMECommerceReferrer?) -> YMMECommerce
Creates an E-commerce event called ShowProductDetailsEvent
. Use it to report viewing a product page.
product | The product that was shown. The YMMECommerceProduct class instance. |
referrer | Information about the source of traffic to the product page. The YMMECommerceReferrer class instance. |
product | The product that was shown. The YMMECommerceProduct class instance. |
referrer | Information about the source of traffic to the product page. The YMMECommerceReferrer class instance. |
Returns:
The YMMECommerce
class instance.
addCartItemEvent(cartItem:)
static func addCartItemEvent(cartItem: YMMECommerceCartItem) -> YMMECommerce
Creates an E-commerce event called AddCartItemEvent
. Use it to report adding an item to the cart.
item | The item that was added to the cart. The YMMECommerceCartItem class instance. |
item | The item that was added to the cart. The YMMECommerceCartItem class instance. |
Returns:
The YMMECommerce
class instance.
removeCartItemEvent(cartItem:)
static func removeCartItemEvent(cartItem: YMMECommerceCartItem) -> YMMECommerce
Creates an E-commerce event called RemoveCartItemEvent
. Use it to report removing an item from the cart.
item | The item that was removed from the cart. The YMMECommerceCartItem class instance. |
item | The item that was removed from the cart. The YMMECommerceCartItem class instance. |
Returns:
The YMMECommerce
class instance.
beginCheckoutEvent(order:)
static func beginCheckoutEvent(order: YMMECommerceOrder) -> YMMECommerce
Creates an E-commerce event called BeginCheckoutEvent
. Use it to report starting a purchase.
order | Information about the purchase. The YMMECommerceOrder class instance. |
order | Information about the purchase. The YMMECommerceOrder class instance. |
Returns:
The YMMECommerce
class instance.
purchaseEvent(order:)
static func purchaseEvent(order: YMMECommerceOrder) -> YMMECommerce
Creates an E-commerce event called PurchaseEvent
. Use it to report a completed purchase.
order | Information about the purchase. The YMMECommerceOrder class instance. |
order | Information about the purchase. The YMMECommerceOrder class instance. |
Returns:
The YMMECommerce
class instance.