E-commerce tracking captures the shopping flow in your iOS app — from product views and add-to-cart actions to purchases. Build an MIEcommerceParameters object containing one or more MIProduct entries and attach it to a page or action event.
Before you start, complete the Quickstart so the SDK is initialized.
How it works
E-commerce data has no dedicated track… method. Instead, you attach MIEcommerceParameters to an existing event:
The combination of status and the screen on which you send the event determines what kind of e-commerce step is recorded (view, add-to-cart, purchase, …).
MIEcommerceParameters
Property | Description |
|---|---|
| Array of |
|
|
| ISO currency code (for example |
| Unique identifier of the order (used with |
| Total order value as |
| Flag for new vs returning customer. |
| Value of returned items. |
| Value of cancelled items. |
| Coupon discount applied to the order. |
| Selected payment method. |
| Carrier name. |
| Shipping speed (for example |
| Shipping cost. |
| Markup value. |
| Free-text order status string. |
| Dictionary of numbered custom e-commerce parameters. |
MIProduct
Property | Description |
|---|---|
| Product name (typically SKU). |
| Product price as |
| Quantity of this product in the event. |
| Advertise ID for the product. |
| Whether the product is sold out. |
| Variant identifier (for example |
| Dictionary of numbered product categories. |
| Dictionary of numbered product-level custom parameters. |
Examples
Track a product view
Attach an MIEcommerceParameters with status .viewed to the page event for a product detail screen.
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];Track an order confirmation
Use status .purchased together with orderID and orderValue on the confirmation screen — once per successful order.
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
purchasedstatus only on the order confirmation screen, after a successful purchase. Sendingpurchasedmultiple times for the same order leads to inflated revenue numbers.