Orders

Prev Next

1 Overview

This page explains how to track order data in Mapp Intelligence. Orders represent completed transactions and include total order value and other order-specific attributes such as coupon values, shipping costs, and payment methods.

Order data can be analyzed under E-Commerce > Orders.

Note: If no order value is transmitted, the order will not be tracked.


2 Configurable Properties

The following table outlines all supported order properties, their descriptions, and request parameters.

Property

Description

Data Type

Request Parameter

value

Total order value. Required. Without this value, no order is tracked. Use a dot or comma as decimal separator. No thousands separator allowed.

Number

ov

id

Unique identifier for the order. Prevents double counting. Optional.

String

oi

currency

ISO code of the currency (e.g., "USD") for the order. This value is only passed for currency conversion.

The order value will be converted into the default currency defined in your system configuration ({{glossary.Int: Mapp Q3}} > Configuration > System Configuration > Data Collection).

String

cr

couponValue

Value of the applied coupon.

Number

cb563

paymentMethod

Payment method used for the order.

String

cb761

shippingService

Shipping provider used for the order.

String

cb762

shippingSpeed

Shipping speed chosen for the order.

String

cb764

shippingCosts

Shipping cost for the order.

Number

cb765

grossMargin

Margin or markup of the order.

Number

cb766

orderStatus

Status of the order (e.g., confirmed, cancelled).

String

cb767

productSoldOut

Flag indicating whether a product in the order is out of stock.

Boolean

cb760

tax

Tax amount.

Number

cb759

parameter

Custom order-specific parameters. See below.

Object

cb[ID]

2.1 Parameters

Order parameters can be used to enrich tracked order data with additional information such as shipping or payment type.

Mapp Intelligence provides a set of predefined E-Commerce parameters, including the ones listed above (e.g., paymentMethod, shippingCosts). These predefined parameters must be set up in Configuration > Custom Parameters > ECommerce Parameter before use. During setup, the ID (used for the request parameter) and data type (text or number) are defined.

Custom parameters are supported as well. You can use any available ID (e.g., cb45) and assign a value depending on your needs. If you transmit multiple custom parameters, each must use a unique ID.

Values can be analyzed in E-Commerce > E-Commerce Parameters if they are of type text, or as metrics if they are of type number.

For setup instructions: How to Set Up Custom Parameters


3 Objects and Methods

Mapp Intelligence provides two tracking objects for orders:

  • data: Use this object to configure the full order setup.

  • parameter: Use this object to manage order parameters independently.

Each object supports four methods:

Method

Description

set()

Overwrites all existing values.

add()

Adds or updates values. Existing values remain unchanged.

get()

Returns the current configuration.

remove()

Deletes the entire configuration or selected values.

3.1 data – Full Order Configuration

/**
 * @param {{
 *      value: number,
 *      [id=""]: string,
 *      [currency=""]: string,
 *      [couponValue=0]: number,
 *      [paymentMethod=""]: string,
 *      [shippingService=""]: string,
 *      [shippingSpeed=""]: string,
 *      [shippingCosts=0]: number,
 *      [grossMargin=0]: number,
 *      [orderStatus=""]: string,
 *      [parameter={}]: {[number]: string}
 * }} data
 *
 * @returns {wtSmart.order.data}
 */
wtSmart.order.data.set(data);
/**
 * @param {{
 *      [value]: number,
 *      [id]: string,
 *      [currency]: string,
 *      [couponValue]: number,
 *      [paymentMethod]: string,
 *      [shippingService]: string,
 *      [shippingSpeed]: string,
 *      [shippingCosts]: number,
 *      [grossMargin]: number,
 *      [orderStatus]: string,
 *      [parameter]: {[number]: string}
 * }} data
 *
 * @returns {wtSmart.order.data}
 */
wtSmart.order.data.add(data);
/**
 * @returns {{
 *      value: number,
 *      id: string,
 *      currency: string,
 *      couponValue: number,
 *      paymentMethod: string,
 *      shippingService: string,
 *      shippingSpeed: string,
 *      shippingCosts: number,
 *      grossMargin: number,
 *      orderStatus: string,
 *      parameter: {[number]: string}
 * }}
 */
wtSmart.order.data.get();
/**
 * @param {string[]} [removeList]
 *
 * @returns {wtSmart.order.data}
 */
wtSmart.order.data.remove(removeList);

Example

// set order data
wtSmart.order.data.set({
	value: 120.99,
	id: 'M-12345',
	couponValue: 10.00,
	paymentMethod: 'paypal',
	shippingService: 'dhl',
	shippingSpeed: 'express',
	shippingCosts: 4.95,
	grossMargin: 12.95,
	parameter: {
		5: 'bill'
	}
});

// add order data
wtSmart.order.data.add({
    currency: 'EUR'
});

// get order data
var data = wtSmart.order.data.get();
  
// remove all order data
wtSmart.order.data.remove();

// remove only couponValue from order data
wtSmart.order.data.remove(['couponValue']);

3.2 parameter – Custom Order Parameters

/**
 * @param {{[number]: string}} data
 *
 * @returns {wtSmart.order.parameter}
 */
wtSmart.order.parameter.set(data);
/**
 * @param {{[number]: string}} data
 *
 * @returns {wtSmart.order.parameter}
 */
wtSmart.order.parameter.add(data);
/**
 * @returns {{[number]: string}}
 */
wtSmart.order.parameter.get();
/**
 * @param {number[]} [removeList]
 *
 * @returns {wtSmart.order.parameter}
 */
wtSmart.order.parameter.remove(removeList);

Example

// set order parameter
wtSmart.order.parameter.set({
    1: 'bill'
});

// add order parameter
wtSmart.order.parameter.add({
    7: 'foo.bar'
});

// get order parameter
var data = wtSmart.order.parameter.get();
  
// remove all order parameter
wtSmart.order.parameter.remove();

// remove only order parameter 7
wtSmart.order.parameter.remove([7]);

4 Code Generator

Use the code generator to create individual code that you can then integrate directly into your website.