User Interaction Tracking

Prev Next

Overview

User Interaction Tracking records the kind of customer behavior required to use Mapp Fashion in a meaningful way. It captures page views, product views, basket actions, and completed orders. These events provide the context used for recommendations, reporting, and attribution.

Without User Interaction Tracking, Mapp Fashion can’t reliably interpret customer behavior or link interactions to products and conversions.

Here we’ll explain which customer interactions must be tracked and how to trigger the corresponding events. As a prerequisite, Integrated Tracking and the Mapp Fashion extension should already be set up.


Tracking Events and Functions

Each of the following tracking methods captures a specific type of customer interaction. Use these calls to record the corresponding actions at the appropriate point in your site logic.


Page View Tracking

Tracks when a shopper views a page. This function is essential for linking all subsequent events, especially when the user has multiple tabs open. Always trigger a page view before sending any product, basket, or order events to ensure proper session context.

wtSmart.track();

Identify (Customer Identification)

Connects customer actions before and after login. Use this function when a customer:

  • Logs in

  • Registers a new account

You can also include customer identity details in the order event to link purchases with known users.

Warning

Customer identity details can also be included in the order event to associate purchases with known customers.

Example

wtSmart.customer.data.set({
  registrationEmail: "customer@example.com", // pseudonymized automatically
  id: "id_from_your_database_here"
});

Parameters

Parameter

Type

Description

registrationEmail

String

Customer email. Automatically pseudonymized (hashed), but not fully anonymized.

id

String

Stable unique identifier, such as a database ID.


Product Detail Page (PDP) /itemView

Captures when a shopper views a specific product detail page or product view. Trigger this event when a customer:

  • opens a product detail page

  • switches to another product variant (for example, color or size)

  • views products that are loaded dynamically via JavaScript

If products are loaded dynamically, trigger a new PDP call for each view.

Example

wtSmart.product.view.data.set([{
  id: "SKU-12345",
  cost: 99.90,
  quantity: 1,
  variant: "ABC123",
  fashionStyleId: "XYZ789"
}]);

Parameters

Parameter

Type

Description

id

String

Unique product identifier. Use a SKU or article number to support catalog imports.

quantity

Number

Quantity of products added or removed.

cost

Number

Unit price of the product.

variant

String

Identifier of the product’s variant or style context (not SKU-level).

fashionStyleId

String

Product code or variant identifier (for example, style or group code).

Note:

Both variant and fashionStyleId are mandatory. Always provide both for accurate tracking and reporting.


Add to Basket / Remove from Basket

Use this function when a shopper adds or removes a product from their basket.

Example

wtSmart.product.addToCart.data.set([{
  id: "SKU-12345",
  cost: 99.90,
  quantity: 1,
  variant: "ABC123",
  currency: "GBP"
  fashionItemTitle: "Dress",
  fashionItemCategory: "Dresses"
}]);

wtSmart.product.deleteFromCart.data.set([{
  id: "SKU-12345",
  cost: 99.90,
  quantity: 1,
  variant: "ABC123",
  currency: "GBP"
  fashionItemTitle: "Dress",
  fashionItemCategory: "Dresses"
}]);

Parameters

Parameter

Type

Description

id

String

A unique product identifier. Use a SKU or article number to support catalog imports.

variant

String

Identifier of the product’s variant or style context (not SKU-level).

quantity

Number

Quantity of items added or removed.

fashionItemTitle

String

Product name.

fashionItemCategory

String

Product category.

cost

Number

Unit price of the product.

currency

String

ISO currency code (e.g., GBP, EUR).


Order Confirmation

Captures completed orders.

Each order must include at least one product entry. A product entry represents a specific product variant and its corresponding quantity that is part of the order. These entries use the same product parameters as other product tracking events, but are submitted in the context of an order.

An order is considered invalid if:

  • No line items are provided, or

  • A line item has no variant or quantity

Example

wtSmart.order.data.set({
  value: 120.99,
  id: 'M-12345',
  tax: 19.99,
  shippingCosts: 4.95,
  currency: "GBP"
});

wtSmart.product.confirmation.data.set([{
  id: "SKU-12345",
  cost: 99.90,
  quantity: 1,
  variant: "ABC123",
  currency: "GBP"
  fashionItemTitle: "Dress",
  fashionItemCategory: "Dresses"
}]);

Order Parameters

Parameter

Type

Description

id

String

Unique order identifier.

value

Number

Total order value.

tax

Number

Tax amount.

shippingCosts

Number

Shipping cost.

currency

String

ISO currency code (e.g., GBP).

Product Parameters

Parameter

Type

Description

id

String

A unique product identifier. Use a SKU or article number to support catalog imports.

variant

String

Identifier of the product’s variant or style context (not SKU-level).

fashionItemTitle

String

Product name.

cost

Number

Price per unit.

quantity

Number

Quantity ordered.

currency

String

Currency code.