The scroll position plugin is used to record how far users scroll down on a web page. This is a reference value that is of interest when you wish to find out more about user behavior. Learn more here.

A predefined ID is assigned to each parameter:

  • Event parameter 540: Scroll Depth

Methods and properties

name

Get the name of the extension.

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

version

Get the version of the extension.

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

config

Set and get the current configuration of the extension.

  • roundResult: By default the scroll position in percent gets rounded up to full fives. Deactivate this option, to receive more detailed results.
  • pageHeight: Enter the parameter ID of the 'action parameter', which should be used for the absolute height of the page.
  • sendAsFigure: By default the scroll position gets send through a predefined Mapp Intelligence parameter. This parameter is configured as text and isn't changeable. You can define the scroll position as an additional "number" parameter(custom click parameter), to use it in more analyses.
/**
 * @param {{
 *      [roundResult=true]: boolean,
 *      [pageHeight=""]: string,
 *      [sendAsFigure=""]: string
 * }} [config]
 *
 * @returns {object}
 */
wtSmart.extension.scroll_position.config(config);
JS

isActivated

Get the status, if the extension is enabled.

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

activate

Activate the extension.

wtSmart.extension.scroll_position.activate();
JS

deactivate

Deactivate the extension.

wtSmart.extension.scroll_position.deactivate();
JS

simulate

Simulate an internal scroll or unload event.

/**
 * @param {string} eventName (scroll | unload)
 */
wtSmart.extension.scroll_position.simulate(eventName);
JS

Example

// is scroll position activated
var isActivated = wtSmart.extension.scroll_position.isActivated();

// set scroll position config
wtSmart.extension.scroll_position.config({
    roundResult: false,
    pageHeight: '16',
    sendAsFigure: '17'
});

// get scroll position config
var scrollPositionConfig = wtSmart.extension.scroll_position.config();

// activate scroll position
wtSmart.extension.scroll_position.activate();

// deactivate scroll position
wtSmart.extension.scroll_position.deactivate();

// simulate an internal unload event
wtSmart.extension.scroll_position.simulate('unload');
JS