Products and Orders

Prev Next

E‑commerce tracking captures the shopping flow in your iOS app — from product views and add‑to‑cart actions to purchases. Attach an MIEcommerceParameters object containing one or more MIProduct entries to a page or action event.

MIEcommerceParameters

Property

Description

products

Array of MIProduct entries that describe the products in this event.

status

MIStatus enum (raw values in parentheses):

  • noneStatus (0) — no e‑commerce status

  • addedToBasket (1)

  • purchased (2) — order confirmation

  • viewed (3) — product / list view

  • deletedFromBasket (4)

  • addedToWishlist (5)

  • deletedFromWishlist (6)

  • checkout (7)

currency

ISO currency code (for example "EUR", "USD").

orderID

Unique identifier of the order (used with purchased status).

orderValue

Total order value as NSNumber.

returningOrNewCustomer

Flag for new vs returning customer.

returnValue

Value of returned items.

cancellationValue

Value of cancelled items.

couponValue

Coupon discount applied to the order.

paymentMethod

Selected payment method.

shippingServiceProvider

Carrier name.

shippingSpeed

Shipping speed (for example "standard", "express").

shippingCost

Shipping cost.

markUp

Markup value.

orderStatus

Free‑text order status string.

customParameters

Dictionary of numbered custom e‑commerce parameters.

MIProduct

Property

Description

name

Product name (typically SKU).

cost

Product price as NSNumber.

quantity

Quantity of this product in the event.

productAdvertiseID

Advertise ID for the product.

productSoldOut

Whether the product is sold out.

productVariant

Variant identifier (for example "red-large").

categories

Dictionary of numbered product categories.

ecommerceParameters

Dictionary of numbered product‑level custom parameters.

Example: track a product view

let product = MIProduct(dictionary: [:])
product.name = "SKU-12345"
product.cost = 49.90
product.quantity = 1

let ecommerce = MIEcommerceParameters()
ecommerce.products = [product]
ecommerce.status = .viewed
ecommerce.currency = "EUR"

let pageEvent = MIPageViewEvent(name: "Product Detail")
pageEvent.ecommerceParameters = ecommerce

MappIntelligence.shared()?.trackPage(pageEvent)
MIProduct *product = [[MIProduct alloc] initWithDictionary:@{}];
product.name = @"SKU-12345";
product.cost = @49.90;
product.quantity = @1;

MIEcommerceParameters *ecommerce = [[MIEcommerceParameters alloc] init];
ecommerce.products = @[product];
ecommerce.status = viewed;
ecommerce.currency = @"EUR";

MIPageViewEvent *pageEvent = [[MIPageViewEvent alloc] initWithName:@"Product Detail"];
pageEvent.ecommerceParameters = ecommerce;

[[MappIntelligence shared] trackPage:pageEvent];

Example: track an order confirmation

let ecommerce = MIEcommerceParameters()
ecommerce.products = orderedProducts // [MIProduct]
ecommerce.status = .purchased
ecommerce.orderID = "order-2026-04-28-0001"
ecommerce.orderValue = 149.70
ecommerce.currency = "EUR"
ecommerce.paymentMethod = "credit_card"

let pageEvent = MIPageViewEvent(name: "Order Confirmation")
pageEvent.ecommerceParameters = ecommerce

MappIntelligence.shared()?.trackPage(pageEvent)
MIEcommerceParameters *ecommerce = [[MIEcommerceParameters alloc] init];
ecommerce.products = orderedProducts; // NSArray<MIProduct *> *
ecommerce.status = purchased;
ecommerce.orderID = @"order-2026-04-28-0001";
ecommerce.orderValue = @149.70;
ecommerce.currency = @"EUR";
ecommerce.paymentMethod = @"credit_card";

MIPageViewEvent *pageEvent = [[MIPageViewEvent alloc] initWithName:@"Order Confirmation"];
pageEvent.ecommerceParameters = ecommerce;

[[MappIntelligence shared] trackPage:pageEvent];

Use the purchased status only on the order confirmation screen, after a successful purchase. Sending purchased multiple times for the same order leads to inflated revenue numbers.

Related: Object Oriented Tracking, Pages, Events.