--- title: "Step 2: Configuring and Activating the Plugin" slug: "recommendation-tracking-step-2-configuring-and-activating-the-plugin" description: "Configure and activate the Recommendation Tracking extension: set viewable thresholds, event limits and the attribution cookie before calling activate()." updated: 2026-10-07T10:34:38Z published: 2026-10-07T10:34:38Z canonical: "docs.mapp.com/recommendation-tracking-step-2-configuring-and-activating-the-plugin" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.mapp.com/llms.txt > Use this file to discover all available pages before exploring further. # Step 2: Configuring and Activating the Plugin After creating the required E-Commerce parameters, configure and activate the Recommendation Tracking extension. Then register the product elements of your recommendation widgets. --- ## 1) Configure the extension Use `config()` to define when a product counts as viewable, how many recommendation events are sent, and whether a cookie is used to store the widget context for attribution. All options are optional. ```javascript wtSmart.extension.recommendation_tracking.config({  viewPercent: 100,  viewTime: 1000,  maxSendProducts: {    session: 10000,    page: 1000  },  maxCookieSize: 4000 }); ``` > [!WARNING] > Warning > > Call `config()` before `activate()`. Values for `viewPercent` and `viewTime` that are set after activation are ignored, and the defaults stay in effect. ### Options | **Option** | **Type** | **Default** | **Description** | | --- | --- | --- | --- | | viewPercent | number | 100 | Share of the product element, in percent, that must be inside the visible browser window for the product to count as viewable. The share refers to the area of the element itself. The same value applies on every screen size, so choose one that works for the smallest layout your widget is displayed in. A value that is too high means that products, for example in carousels or on small screens, are counted as loaded and clicked but never as viewable. A value that is too low counts products the visitor had no real chance to see. | | viewTime | number | 1000 | Time in milliseconds that the element must stay visible to count as viewable. | | maxSendProducts.session | number | 10000 | Maximum number of loaded and viewable events per session. Every product uses one slot per event. Click events are not limited. `-1` = unlimited | | maxSendProducts.page | number | 1000 | Maximum number of loaded and viewable events per page view. Every product uses one slot per event. Click events are not limited. `-1` = unlimited | | maxCookieSize | number | 4000 | Maximum size of the cookie in characters. When the cookie is full, the oldest entry is removed to make room for the new one. `-1` disables cookie usage and with it attribution. | > [!NOTE] > Note > > The extension uses two cookies. By default, the cookie `wtstp_pt_c_<trackId>` stores the context of clicked products for up to seven days so that it can be included in the purchase request. It stores all fields provided in the data object (for example id, placement, algorithm, and position). The session cookie `wtstp_pt_s_<trackId>` counts the sent events against the session limit. --- ## 2) Activate the extension ```javascript wtSmart.extension.recommendation_tracking.activate(); ``` Optional methods: ```javascript wtSmart.extension.recommendation_tracking.deactivate(); wtSmart.extension.recommendation_tracking.isActivated(); ```