Recommendation Tracking

Prev Next

The Recommendation Tracking extension enables product-level analysis of recommendation widgets in Mapp Intelligence.

It records when recommended products are loaded into a widget, become viewable on screen, and are clicked, and sends additional widget context, such as placement, product position, and algorithm. If a recommended product is clicked and later purchased within seven days, the stored widget context is included in the purchase request. Attribution follows a last-click approach.

These values are passed via predefined E-Commerce parameters.

Full implementation guide

This page documents the Smart Pixel interface of the extension. For the product statuses and what triggers them, setup, parameter requirements, testing and reporting, see the dedicated Recommendation Tracking plugin documentation.


Methods and properties

name

Get the name of the extension.

/**
 * @type {string}
 */
wtSmart.extension.recommendation_tracking.name;

version

Get the version of the extension.

/**
 * @type {string}
 */
wtSmart.extension.recommendation_tracking.version;

config

Set and get the current configuration of the extension. The options, their defaults and their effects are described in Step 2: Configuring and Activating the Plugin.

/**
 * @param {{
 *      [viewPercent=100]: number,
 *      [viewTime=1000]: number,
 *      [maxSendProducts]: {
 *          [session=10000]: number,
 *          [page=1000]: number
 *      },
 *      [maxCookieSize=4000]: number
 * }} [config]
 *
 * @returns {object}
 */
wtSmart.extension.recommendation_tracking.config(config);

isActivated

Get the status of whether the extension is enabled.

/**
 * @returns {boolean}
 */
wtSmart.extension.recommendation_tracking.isActivated();

activate

Activate the extension.

wtSmart.extension.recommendation_tracking.activate();

deactivate

Deactivate the extension.

wtSmart.extension.recommendation_tracking.deactivate();

add

Register a recommended product element for tracking. Call add() once for every product element. The fields, the timing of the registration and the click tracking are described in Step 3: Registering Recommendation.

/**
 * @param {{
 *      selector: string | HTMLElement,
 *      [shadowRoot]: string,
 *      [exclude]: string[] | HTMLElement[],
 *      data: {
 *          id: string,
 *          cost: string | number,
 *          [productId]: string,
 *          [currency]: string,
 *          [placement]: string,
 *          [algorithm]: string,
 *          [occasion]: string,
 *          [position]: string | number
 *      }
 * }} item
 */
wtSmart.extension.recommendation_tracking.add({
    selector: "li.item:nth-of-type(2)",
    shadowRoot: "#product-collection",
    exclude: ["li.item:nth-of-type(2) a:last-child"],
    data: {
        id: 'MP-12',
        cost: 19.95,
        productId: 'MP',
        currency: 'EUR',
        placement: 'pdp',
        algorithm: 'similar items',
        occasion: 'casual',
        position: 3
    }
});

Example

// is recommendation tracking activated
var isActivated = wtSmart.extension.recommendation_tracking.isActivated();

// set recommendation tracking config
wtSmart.extension.recommendation_tracking.config({
    viewPercent: 100,
    viewTime: 1000,
    maxSendProducts: {
        session: 10000,
        page: 1000
    },
    maxCookieSize: 4000
});

// activate recommendation tracking
wtSmart.extension.recommendation_tracking.activate();

// deactivate recommendation tracking
wtSmart.extension.recommendation_tracking.deactivate();

Testing your implementation

Recommendation events can be checked in the Mapp Cloud Debugger. The events, how to trigger them and what to look for are documented in Step 3: Registering Recommendation.