--- title: "Sessions" slug: "intelligence-smart-pixel-sessions" updated: 2025-03-27T11:11:00Z published: 2025-03-27T11:11:00Z canonical: "docs.mapp.com/intelligence-smart-pixel-sessions" --- > ## 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. # Sessions ## 1 Overview Session parameters refer to an entire visit (also known as a session). They are used when you want to persist a value throughout the entire visit rather than just a single page view or interaction. A common example is the login status of a user. Initially, a session might be classified as "not logged-in". Once the login occurs, the value can be updated to reflect the new status. Depending on your configuration, only the first or last value passed during the session will be considered. > [!NOTE] > **Note:** A session in Mapp Intelligence corresponds to a *Visit* in the frontend. Technically, the terms "session" and "visit" are used interchangeably. --- ## 2 Configurable Properties | Property | Description | Request Parameter | | --- | --- | --- | | loginStatus | Indicates whether a user is logged in during a session. This value can be passed once per visit. | `cs800` | | parameter | Tracks additional custom data points for a session. More details below. | `cs[ID]` | ### 2.1 Parameters Session parameters are additional attributes that can be configured to collect custom data relevant to the entire session. You must define these parameters in the system configuration (*Configuration > Custom Parameters > Session Parameter*), including the ID and the data type (text or number). - Values can be analyzed in *Visitors > Session Parameters* if they are of type **text**, or as **metrics** if they are of type **number**. > [!NOTE] > **Note:** If a session parameter is passed multiple times during a visit, Mapp Intelligence will evaluate either the first or last value based on the system configuration. For setup instructions: [How to Set Up Custom Parameters](/v1/docs/how-to-set-up-custom-parameters) --- ## 3 Objects and Methods Mapp Intelligence provides two tracking objects for sessions: - **data**: Use this object to configure the full session setup. - **parameter**: Use this object to manage session parameters independently. Each object supports four methods: | **Method** | **Description** | | --- | --- | | `set()` | Overwrites all existing values. | | `add()` | Adds or updates values. Existing values remain unchanged unless replaced. | | `get()` | Returns the current configuration. | | `remove()` | Deletes the entire configuration or selected values. | ### 3.1 data – Full Session Configuration SetAddGetRemove ```javascript /** * @param {{ *      [loginStatus=""]: string, *      [parameter={}]: {[number]: string} * }} data * * @returns {wtSmart.session.data} */ wtSmart.session.data.set(data); ``` ```javascript /** * @param {{ *      [loginStatus]: string, *      [parameter]: {[number]: string} * }} data * * @returns {wtSmart.session.data} */ wtSmart.session.data.add(data); ``` ```javascript /** * @returns {{ *      loginStatus: string, *      parameter: {[number]: string} * }} */ wtSmart.session.data.get(); ``` ```javascript /** * @param {string[]} [removeList] * * @returns {wtSmart.session.data} */ wtSmart.session.data.remove(removeList); ``` **Example** ```javascript // set session data wtSmart.session.data.set({ loginStatus: 'login', parameter: { 5: 'male' } }); // add session data wtSmart.session.data.add({    loginStatus: 'logout' }); // get session data var data = wtSmart.session.data.get();   // remove all session data wtSmart.session.data.remove(); // remove only loginStatus from session data wtSmart.session.data.remove(['loginStatus']); ``` ### 3.2 parameter – Session Parameters Only SetAddGetRemove ```javascript /** * @param {{[number]: string}} data * * @returns {wtSmart.session.parameter} */ wtSmart.session.parameter.set(data); ``` ```javascript /** * @param {{[number]: string}} data * * @returns {wtSmart.session.parameter} */ wtSmart.session.parameter.add(data); ``` ```javascript /** * @returns {{[number]: string}} */ wtSmart.session.parameter.get(); ``` ```javascript /** * @param {number[]} [removeList] * * @returns {wtSmart.session.parameter} */ wtSmart.session.parameter.remove(removeList); ``` **Example** ```javascript // set session parameter wtSmart.session.parameter.set({    1: 'male' }); // add session parameter wtSmart.session.parameter.add({    7: 'foo.bar' }); // get session parameter var data = wtSmart.session.parameter.get();   // remove all session parameter wtSmart.session.parameter.remove(); // remove only session parameter 1 wtSmart.session.parameter.remove([1]); ``` --- ## 4 Code Generator Use the code generator to create individual code that you can then integrate directly into your website. [Embedded content](https://static.webtrekk.com/pixel/wtsmart-gui/data/session/?nohelp=1)