In this section, you will find the steps to integrate the Cookie Control plugin based on the used pixel integration.


Cookies are text files that can be created when a website is visited and then stored on the user’s device/computer. Every cookie is tied to the respective domain and can only be read or altered where it was set.

Mapp Intelligence uses cookies for user identification. We differentiate between session cookies and ever-cookies. A session cookie is automatically removed by the browser at the end of the session. This is done as soon as the browser is closed. In contrast to a session cookie, an ever-cookie has a fixed expiration date and is removed by the browser on that date.


Cookies are classified as 1st- or 3rd-party cookies. 1st-party cookies are set in the domain of the website that is currently being actively visited. 3rd-party cookies on the other hand are set in a different domain that does not correspond to the page currently being visited.

Tracking with Mapp Intelligence is possible both with 1st-party (client-side) and 3rd-party (server side) cookies.


The Cookie-Control plugin allows you to access the "properties" of the Mapp Intelligence cookies. Cookies can be:

  • assigned a new trackDomain and/or trackID or
  • migrated from a client cookie to a server cookie (1st-party cookie to 3rd-party cookie).

Methods and properties

name

Get the name of the extension.

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

version

Get the version of the extension.

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

config

Set and get the current configuration of the extension.

  • action: Contains the type of cookie migration (1->3 or 3->3)
  • lifeTime: Contains the date until all cookies have been moved (maximum 6 months)
  • duration: Specifies the term of the cookie in days [optional]
  • currentTrackId: Contains your current Mapp Intelligence trackID
  • currentTrackDomain: Contains your current Mapp Intelligence trackDomain
  • oldTrackId: Contains your former Mapp Intelligence trackID (relevant for 3->3)
  • oldTrackDomain: Contains your former Mapp Intelligence trackDomain (relevant for 3->3)
/**
 * @param {{
 *      action: string,
 *      lifeTime: string,
 *      [duration=180}: number,
 *      [currentTrackId=current trackID]: string,
 *      [currentTrackDomain=current trackDomain]: string,
 *      oldTrackId: string,
 *      oldTrackDomain: string
 * }} [config]
 *
 * @returns {object}
 */
wtSmart.extension.cookie_control.config(config);
JS

isActivated

Get the status, if the extension is enabled.

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

activate

Activate the extension.

wtSmart.extension.cookie_control.activate();
JS

deactivate

Deactivate the extension.

wtSmart.extension.cookie_control.deactivate();
JS

Switching from 1st- to 3rd-party cookies

With this version, the cookie that was set on the client-side (cookie="1") is converted to a cookie that is set on the server-side (cookie="3").

  • lifeTime: Contains the date until all cookies have been moved (maximum 6 months)
  • duration: Specifies the term of the cookie in days [optional]
  • action: Contains the type of cookie migration
// is cookie control activated
var isActivated = wtSmart.extension.cookie_control.isActivated();

// set cookie control config
wtSmart.extension.cookie_control.config({
    action: '1->3',
    lifeTime: '01 Aug 2020 00:00:00',
    duration: 180
});

// get cookie control config
var cookieControlConfig = wtSmart.extension.cookie_control.config();

// activate cookie control
wtSmart.extension.cookie_control.activate();

// deactivate cookie control
wtSmart.extension.cookie_control.deactivate();
JS

Migrating 3rd-party cookies to a new domain

This version allows you to migrate the cookies to a new trackDomain and/or trackID.

  • lifeTime: Contains the date until all cookies have been moved (maximum 6 months)
  • duration: Specifies the term of the cookie in days [optional]
  • action: Contains the type of cookie migration
  • currentTrackId: Contains your current Mapp Intelligence trackID
  • currentTrackDomain: Contains your current Mapp Intelligence trackDomain
  • oldTrackId: Contains your former Mapp Intelligence trackID
  • oldTrackDomain: Contains your former Mapp Intelligence trackDomain
// is cookie control activated
var isActivated = wtSmart.extension.cookie_control.isActivated();

// set cookie control config
wtSmart.extension.cookie_control.config({
    action: '3->3',
    lifeTime: '01 Aug 2020 00:00:00',
    duration: 180,
    currentTrackId: '123451234512345',
    currentTrackDomain: 'q3.webtrekk.net',
    oldTrackId: '543215432154321',
    oldTrackDomain: 'wt01.webtrekk.net'
});

// get cookie control config
var cookieControlConfig = wtSmart.extension.cookie_control.config();

// activate cookie control
wtSmart.extension.cookie_control.activate();

// deactivate cookie control
wtSmart.extension.cookie_control.deactivate();
JS





Integrate the Cookie Control plugin into the container in which the webpage to be measured is located. But first, you need to create a new custom plugin.

  1. In Tag Integration, navigate to Custom Plugins and click New plugin. The configuration dialog for new custom plugins opens.


  2. Now make the following settings:


    ParameterDescription
    NameEnter the plugin name, for example, "Cookie Control Plugin."
    ContentCopy the code from the JavaScript file "webtrekk_cookieControl.min.js", which is made available to you on request.
    PositionChoose from the dropdown menu the following position:
    • head
  3. Then click Create. The plugin is created and appears in the custom plugin overview.

  4. In the container overview, select the required container by clicking the corresponding entry.

  5. Click Add Plugin. You will be forwarded to the overview of all available plugins.

  6. Under Custom Plugins, select the plugin that you have created, for example "Cookie Control Plugin". The plugin configuration dialog opens.

  7. In the Assign rules area, you define the page areas on which the measurement is to be carried out.

  8. Then click Add plugin.

  9. Finally, click Publish to publish your container, including the newly added Cookie Control plugin.


Follow these steps to integrate the plugin:

  1. As this plugin is not free of charge, you can obtain it upon request from your Mapp consultant. The JavaScript file "webtrekk_cookieControl.min.js" will be made available to you on request.  

  2. Integrate the provided script before the script "webtrekk_v4.min.js."

    Example

    <script type="text/javascript" src="path/to/file/webtrekk_cookieControl.min.js"></script>
    <script type="text/javascript" src="path/to/file/webtrekk_v4.min.js"></script>
    XML
  3. The plugin offers two different configuration options for moving cookies. The basic configuration is the same for each variant.

    Example plugin configuration

    var wtcc_config = wtcc_config || {
        trackId : "123451234512345",
        trackDomain : "q3.webtrekk.net",
        version : 3,
        path : "/",
        duration : "180",
        action : {
            // Action -> r | Move server cookie in domain1 to domain2 (cookie=3 -> cookie=3 | new trackDomain or trackId)
            trackId : "123451234512345",
            trackDomain : "q3.webtrekk.net",
            action : "3->3"
     
            // Action -> s | Move client cookie to server cookie (cookie=1 -> cookie=3)
            ////action : "1->3"
        }
    };
    JS


    ParameterDescription
    trackIdSpecify your current Mapp Intelligence track ID.
    trackDomainSpecify your current Mapp Intelligence track domain.
    versionSpecify your current pixel version.
    pathOptional. Specify the path in which the cookie is to be stored.
    durationOptional. Specify the runtime of the cookie (days).
    action
  4. The parameter "executePluginFunction" is used for the activation of the plugin This can be set either in the configuration variable (webtrekkConfig) in the global pixel file (for example, "webtrekk_v3.js") or as a parameter of a page-specific pixel object.

    Example global configuration

    var webtrekkConfig = {
    	trackId: "111111111111111",
    	trackDomain: "track.webtrekk.net",
    	domain: "www.website.com",
    	executePluginFunction: "wt_cookieControl"
    };
    JS


    Example page-specific configuration

    var wt = new webtrekkV3();
    wt.contentId = "de.startseite";
    wt.executePluginFunction = "wt_cookieControl";
    wt.sendinfo();
    JS

On the following pages, you will find more information on the cookie-moving options.