Products and Orders
    • 4 Minutes to read
    • Dark
      Light

    Products and Orders

    • Dark
      Light

    Article Summary

    In Mapp Intelligence, you can analyze in detail which products in your app are viewed, placed in the shopping cart, and bought. Aggregated evaluations are possible across product categories. Intelligence automatically derives abandoned shopping carts from the information transmitted. Comprehensive information must be provided on the underlying order for product purchases, e.g., a unique order number.

    Like orders, any additional information can be added to products using E-Commerce Parameters.

    You must specify the product and the E-Commerce Parameters to track products and orders correctly.

    Product Parameter Constants

    The following information can be configured in the  MIProduct() object:

    Parameter

    Description

    Where to configure (Mapp Q3 > Configuration > ...)

    Where to analyze

    name

    Name of the product to be tracked. Multiple products need to be separated by a semicolon. A product name cannot exceed 110 characters.

    -

    Datatype Text: E-Commerce > []

    Datatype Figure: metric







    cost

    Contains the product price ("0" values are allowed). If you transmit a product several times (quantity parameter PRODUCT_QUANTITY greater than 1), use the total price, not the unit price. If several prices are transmitted, they are each separated by a semicolon.

    -

    quantity

    Contains the product quantity. If several products are transmitted, they are each separated by a semicolon.

    -

    category

    Used to group products. Product categories allow the grouping of products. The relationship between product and product category must be unique.

    Categories > Product Categories


    E-commerce Parameter Constants

    The following information can be configured in the MIEcommerceParameters() object. Custom parameters need to be specified when initializing the object.

    Parameter

    Description

    Where to configure (Mapp Q3 > Configuration > ...)

    Where to analyze

    customParameters

    Used to add additional information to a product or order using parameters (e-commerce parameters)

    Custom Parameters > E-Commerce Parameter

    Datatype Text: E-Commerce > []

    Datatype Figure: metric








    products

    E-commerce object can contain a list of products ( for example, the list of products that are added to a basket)

    -

    status

    Contains the shopping cart status. There are three possible values for the parameter:

    1. viewed: If a product is viewed (e.g., on a product's detailed screen), the status is "view". This status should always be set if the product can be added to the shopping cart.

    2. addedToBasket: If the product is added to the shopping cart, the status is "addedToBasket".

    3. purchased: If the shopping cart is purchased, the status "purchased" is transmitted.

    4. deletedFromBasket: The item is deleted from the cart/basket, e.g., because the user actively deleted it from their shopping cart

    5. addedToWishlist: The status indicates that a user added an item to their wishlist.

    6. deletedFromWishlist: The status means a user deleted an item from their wishlist.

    7. checkout: The status indicates a checkout action.

    -

    currency

    Contains the currency code of an order; the value must be passed to Intelligence in line with the ISO standard. If multiple products are transmitted on a single screen (e.g., on the order confirmation page if more than one product was purchased), only one currency will be applied to all products. This means that the value only needs to be set once.

    Note: The currency is only passed for currency conversion. In other words, the money will be converted to the one (if any) that is stored in the Intelligence front-end (Configuration > System configuration: Data Collection). Only one currency is ever displayed here.

    -

    cancellationValue

    Value of the cancellation.

    -

    couponValue

    Value of the coupon.

    -

    orderId

    Contains a unique order number (order ID). Use of this setting ensures that no orders are counted twice.

    -

    orderValue

    Contains the total order value.

    -

    orderStatus

    Defines order status by custom string.

    -


    paymentMethod

    String, which will describe the payment method.

    -


    productAdvertiseID

    The representation of product advertisement id

    -

    ProductSoldOut

    The number of products which are sold out.

    -

    returnValue

    Return value for the order.

    -

    returningOrNewCustomer

    The string represents kind of customer.

    -

    shippingCost

    The cost for products transport.

    -

    shippingSpeed

    The string represents the speed of shipping for ordered products.

    -

    shippingServiceProvider

    The string represents the name of the shipping/transport company for ordered products.

    -

    Methods for Products and Orders

    Products and eCommerce parameters can be sent in both page and event requests.

    Example iOS

    Please note that custom parameters are optional in the request.

    1. Define all event information you want to track:

      let product = MIProduct()
      product.name = "Product1"
      product.categories = [1: "ProductCat1", 2: "ProductCat2"]
      product.cost = 13
      product.quantity = 4
       
      let ecommerceParameters1:
      MIEcommerceParameters = MIEcommerceParameters(customParameters: [1 : "ProductParam1", 2 : "ProductParam2"])
               
      ecommerceParameters1.products = [product]
      ecommerceParameters1.status = .purchased
      ecommerceParameters1.currency = "EUR"
      ecommerceParameters1.cancellationValue = 2
      ecommerceParameters1.couponValue = 33
      ecommerceParameters1.orderID = 56291
      ecommerceParameters1.orderValue = 456
      ecommerceParameters1.orderStatus = "order received"
      ecommerceParameters1.paymentMethod = "credit card"
      ecommerceParameters1.productAdvertiseID = "udas680sa"
      ecommerceParameters1.productSoldOut = 1
      ecommerceParameters1.returnValue = 3
      ecommerceParameters1.returningOrNewCustomer = "new customer"
      ecommerceParameters1.shippingCost = 35
      ecommerceParameters1.shippingSpeed = "express"
      ecommerceParameters1.shippingServiceProvider = "DHL"
               
      let pageEvent = MIPageViewEvent(name: "TrackProductView")
      pageEvent.ecommerceParameters = ecommerceParameters1
    2. Call the trackPage method.

      MappIntelligence.shared()?.trackPage(pageEvent)

    Full Code Example

    let product1: MIProduct = {
           let product = MIProduct()
           product.name = "Product1"
           product.categories = [1: "ProductCat1", 2: "ProductCat2"]
           product.cost = 13
           return product
    }()
     
    @IBAction func trackEcommerceViewProduct(_ sender: Any) {
             
            let ecommerceParameters1: MIEcommerceParameters =
                MIEcommerceParameters(customParameters: [1 : "ProductParam1", 2 : "ProductParam2"])
             
            ecommerceParameters1.products = [product1]
            ecommerceParameters1.status = .viewed
             
            let pageEvent = MIPageViewEvent(name: "TrackProductView")
            pageEvent.ecommerceParameters = ecommerceParameters1
             
            MappIntelligence.shared()?.trackPage(pageEvent)
    }
    1. Define all event information you want to track:

      MIProduct* product = [[MIProduct alloc] init];
      [product setName:@"Product1"];
      [product setCategories:[@{@1: @"ProductCat1", @2: @"ProductCat2"} copy]];
      [product setCost: [[NSNumber alloc] initWithInt:13]];
      [product setQuantity:[NSNumber numberWithInt:3]];
           
      MIEcommerceParameters* ecommerceParameters1 = [[MIEcommerceParameters alloc] initWithCustomParameters:[@{@1: @"ProductParam1", @2: @"ProductParam2"} copy]];
      [ecommerceParameters1 setProducts: [[NSArray alloc] initWithObjects:product, nil]];
      [ecommerceParameters1 setStatus: purchased];
      [ecommerceParameters1 setCancellationValue: [NSNumber numberWithInt:2]];
      [ecommerceParameters1 setCouponValue:[NSNumber numberWithInt:33]];
      [ecommerceParameters1 setCurrency: @"EUR"];
      [ecommerceParameters1 setOrderStatus:@"order received"];
      [ecommerceParameters1 setOrderID: @"56291"];
      [ecommerceParameters1 setOrderValue:[NSNumber numberWithInt:456]];
      [ecommerceParameters1 setPaymentMethod:@"credit card"];
      [ecommerceParameters1 setProductAdvertiseID:[NSNumber numberWithInt:89706]];
      [ecommerceParameters1 setProductSoldOut:[NSNumber numberWithInt:1]];
      [ecommerceParameters1 setReturnValue:[NSNumber numberWithInt:3]];
      [ecommerceParameters1 setReturningOrNewCustomer:@"new customer"];
      [ecommerceParameters1 setShippingCost:[NSNumber numberWithInt:35]];
      [ecommerceParameters1 setShippingSpeed:@"highest"];
      [ecommerceParameters1 setShippingServiceProvider:@"DHL"];
           
      MIPageViewEvent* pageEvent = [[MIPageViewEvent alloc] initWithName:@"TrackProductView"];
      [pageEvent setEcommerceParameters:ecommerceParameters1];
    2. Call the trackPage method.

      [[MappIntelligence shared] trackPage:pageEvent];

    Full Code Example

    -(void) testProductTractking {
        MIProduct* product = [[MIProduct alloc] init];
        [product setName:@"Product1"];
        [product setCategories:[@{@1: @"ProductCat1", @2: @"ProductCat2"} copy]];
        [product setCost: [[NSNumber alloc] initWithInt:13]];
         
        MIEcommerceParameters* ecommerceParameters1 = [[MIEcommerceParameters alloc] initWithCustomParameters:[@{@1: @"ProductParam1", @2: @"ProductParam2"} copy]];
        [ecommerceParameters1 setProducts: [[NSArray alloc] initWithObjects:product, nil]];
        [ecommerceParameters1 setStatus: viewed];
         
        MIPageViewEvent* pageEvent = [[MIPageViewEvent alloc] initWithName:@"TrackProductView"];
        [pageEvent setEcommerceParameters:ecommerceParameters1];
         
        [[MappIntelligence shared] trackPage:pageEvent];
    }


    Was this article helpful?

    What's Next