Cookie Control
    • 2 Minutes to read
    • Dark
      Light

    Cookie Control

    • Dark
      Light

    Article summary

    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;

    version

    Get the version of the extension.

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

    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);

    isActivated

    Get the status, if the extension is enabled.

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

    activate

    Activate the extension.

    wtSmart.extension.cookie_control.activate();

    deactivate

    Deactivate the extension.

    wtSmart.extension.cookie_control.deactivate();

    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();

    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();


    Was this article helpful?

    What's Next