Privacy

 

Foreword

The Privacy plugin allows you to control the type of information collected according to the legal constraints of each editor depending on regions. You can thus adapt your tagging by a precise management of your various parameters of measurement according to their sensitivity, in the respect of the current regulations.

 

Notion of authority

For its proper working, the plugin relies by default on a configuration defining a set of processing rules to be applied according to the chosen authority. Strictly speaking, an authority represents a control entity in charge of supervising the application of a regulation on the protection of personal data. This is reflected in the code by the presence of configuration objects of type authority comprising different visitorMode: a cnil authority for the application of a specific mode of consent exemption (hybrid CNIL measure) and a default authority for all other cases.

An authority therefore contains different consent modes that can be activated through tagging.

The authority default allows to activate the modes:

  • optin: for exhaustive measurement after consent.
  • optout: for restricted measurement with idclient as “OPT-OUT”.
  • no-consent: for a restricted measurement without cookie deposit and with idclient set to “Consent-No”.
  • random: for a restricted measurement with dynamic idclient changing at each load, before consent.

The cnil authority allows to activate the following mode:

  • exempt: for a hybrid measure with exclusion of data deemed sensitive.

Each visitor mode lists a series of Tracker parameters to be deleted that you can find in cookies, context, buffer (hits parameters) or properties (hits parameters) during normal operation. It is therefore possible to interact at different levels and keep complete control of the data to be transmitted.

When a visitor mode is activated, a cookie called atauthority including the name of the authority and the visitor mode is registered for a configurable duration of 397 days, if the applied rules actually allow this registration.

 

Tagging methods

The plugin provides a series of useful functions in consent management:

 

setVisitorOptout

setVisitorOptout()

Enable default authority “optout” mode.

Example

tag.privacy.setVisitorOptout();
 

setVisitorOptin

setVisitorOptin()

Enable default authority “optin” mode.

Example

tag.privacy.setVisitorOptin();
 

setVisitorRandomID

setVisitorRandomID()

Enable default authority “random” mode.

Example

tag.privacy.setVisitorRandomID();
 

setVisitorMode

setVisitorMode(authority, visitorMode)

Activate a specific mode of an authority.

ParamTypeDescription
authoritystringName of authority
visitorModestringName of visitor mode

Example

tag.privacy.setVisitorMode('default', 'no-consent');
tag.privacy.setVisitorMode('cnil', 'exempt');

The visitor modes, optin, optout and random being generic modes requiring additional intelligence related to the complexity of the business, they have dedicated “helpers” for their activation.

 

getAuthority

getAuthority() ⇒ Object

Retrieve current authority.

Example

var authority = tag.privacy.getAuthority();

Example of a returned object for a “custom” authority:

var authority = {
    "name": "custom", // Name of the authority
    "exempt": { // Visitor mode
        "name": "exempt", // Name of the visitor mode
        "storageDuration": 397, // Cookie retention time in days
        "trackerSettings": { // Tracker settings to apply
            "disableStorage": false,
            "disableCookie": false
        },
        "add": { // Parameters to add
            "buffer": {
                "visitorConsent": {
                    "param": "vc",
                    "value": false
                }, // Addition of the parameter "vc"
                "visitorMode": {
                    "param": "vm",
                    "value": "exempt"
                } // Addition of the parameter "vm"
            }
        },
        "include": { // Parameters to include
            "storage": [
                "atidvisitor", // "atidvisitor" parameter will be allowed in storage (identified visitor)
                {
                    "atredir": [
                        "at",
                        "an"
                    ] // "at" and "an" parameters will be allowed for redirections (identified visitor)
                }
            ],
            "buffer": [
                "an",
                "at",
                "ac",
                "anc",
                "vrn"
            ], // "an", "at", "ac", "anc" and "vrn" parameters will be allowed in buffer (identified visitor)
            "context": [
                {
                    "page": "vrn" // "vrn" parameter will be allowed in context (identified visitor)
                }
            ]
        }
    }
};
 

getVisitorMode

getVisitorMode() ⇒ Object

Retrieve the current visitor mode.

Example

var visitorMode = tag.privacy.getVisitorMode();

Example of a returned object for the “exempt” mode of a “custom” authority:

var visitorMode = {
    "name": "exempt", // Name of the visitor mode
    "storageDuration": 397, // Cookie retention time in days
    "trackerSettings": { // Tracker settings to apply
        "disableStorage": false,
        "disableCookie": false
    },
    "add": { // Parameters to add
        "buffer": {
            "visitorConsent": {
                "param": "vc",
                "value": false
            }, // Addition of the parameter "vc"
            "visitorMode": {
                "param": "vm",
                "value": "exempt"
            } // Addition of the parameter "vm"
        }
    },
    "include": { // Parameters to include
        "storage": [
            "atidvisitor", // "atidvisitor" parameter will be allowed in storage (identified visitor)
            {
                "atredir": [
                    "at",
                    "an"
                ] // "at" and "an" parameters will be allowed for redirections (identified visitor)
            }
        ],
        "buffer": [
            "an",
            "at",
            "ac",
            "anc",
            "vrn"
        ], // "an", "at", "ac", "anc" and "vrn" parameters will be allowed in buffer (identified visitor)
        "context": [
            {
                "page": "vrn" // "vrn" parameter will be allowed in context (identified visitor)
            }
        ]
    }
};
 

extendIncludeStorage

extendIncludeStorage(storageParam)

Add storage parameters to the inclusion list of the current visitor mode.

ParamTypeDescription
storageParamObject|string|arrayStorage parameters

Examples

tag.privacy.extendIncludeStorage('atidvisitor'); // entire atidvisitor storage
tag.privacy.extendIncludeStorage({'atidvisitor': ['an', 'ac']}); // only 'an' and 'ac' from atidvisitor
tag.privacy.extendIncludeStorage([{'atidvisitor': ['an', 'ac']}, {'atredir'}]); // 'an' and 'ac' from atidvisitor and entire atredir
tag.privacy.extendIncludeStorage([{'atidvisitor': ['an', 'ac'], 'atredir': ['an', 'ac']}]); // 'an' and 'ac' from atidvisitor and atredir
 

extendIncludeBuffer

extendIncludeBuffer(bufferParam)

Add buffer parameters to the inclusion list of the current visitor mode.

ParamTypeDescription
bufferParamObject|string|arrayBuffer parameters

Example

tag.privacy.extendIncludeBuffer('an'); // buffer parameter 'an'
tag.privacy.extendIncludeBuffer(['an', 'ac']); // buffer parameters 'an' and 'ac'
tag.privacy.extendIncludeBuffer({stc: ['custom1', 'custom2']}); // buffer parameter 'stc', keys 'custom1' and 'custom2'
 

extendIncludeContext

extendIncludeContext(contextParam)

Add context parameters to the inclusion list of the current visitor mode.

ParamTypeDescription
contextParamObject|string|arrayContext parameters

Example

tag.privacy.extendInclusionContext('campaigns'); // 'campaigns' context
tag.privacy.extendInclusionContext(['campaigns', 'page']); // 'campaigns' and page contexts
tag.privacy.extendInclusionContext({page: 'vrn'}); // vrn parameter in page context
tag.privacy.extendInclusionContext({page: ['vrn', 'weborama']}); // vrn and weborama parameters in page context
 

extendIncludeProperties

extendIncludeProperties(propertiesParam)

Add properties to the inclusion list of the current visitor mode.

ParamTypeDescription
propertiesParamstring|arrayPropriétés

Exemple

tag.privacy.extendIncludeProperties('custom'); // 'custom' property
tag.privacy.extendIncludeProperties(['custom1', 'custom2']); // 'custom1' and custom2 properties
 

updateStorageDuration

updateStorageDuration(storageDuration)

Update the storage duration of the “atauthority” cookie.

ParamTypeDescription
storageDurationnumberLength of retention in days (397 by default)

Example

tag.privacy.updateStorageDuration(90);
 

Use cases

 

Activating the CNIL hybride mode

The activation of the hybrid mode exempt from cnil authority allows very limited measurement by the Tracker. Only the “absolutely necessary” parameters are allowed and tracked. See the list of authorized parameters (by default) :

{
  "include": {
    "storage": [
      "atuserid",
      "atauthority"
    ],
    "buffer": [
      "s",
      "idclient",
      "p",
      "vtag",
      "ptag",
      "ts",
      "vc",
      "vm"
    ],
    "context": [
      {
        "page": [
          "chapter1",
          "chapter2",
          "chapter3",
          "name"
        ]
      }
    ],
    "properties": []
  }
}

Of course, the parameter inclusion list can be extended if necessary. For example, it is possible to add a site custom variable to this list if it is considered that the data is strictly necessary, using the extendIncludeBuffer() method.

Example

var tag = new ATInternet.Tracker.Tag();
tag.privacy.setVisitorMode('cnil', 'exempt');
tag.privacy.extendIncludeBuffer('x1'); // The site custom variable "x1" is added to the inclusion list
tag.page.set({
    name: 'pageName',
    chapter1: 'chap1',
    chapter2: 'chap2',
    chapter3: 'chap3',
    level2: '123',
});
tag.customVars.set({
    site: {
        1: '[site1]'
    }
});
tag.dispatch();
 

Activating the “Opt-out” mode

Activating the default authority optout mode results in a strictly limited action by the Tracker. See the list of authorized parameters (default):

Example

{
  "include": {
    "storage": [
      "atuserid",
      "atauthority"
    ],
    "buffer": [
      "s",
      "idclient",
      "ts",
      "vc",
      "vm"
    ],
    "context": [],
    "properties": []
  }
}

The customer ID then takes the value “OPT-OUT” and the traffic generated is found in the category of traffic excluded at the analysis level.

Example

var tag = new ATInternet.Tracker.Tag();
tag.privacy.setVisitorOptout();
tag.page.set({
    name: 'pageName',
    chapter1: 'chap1',
    chapter2: 'chap2',
    chapter3: 'chap3',
    level2: '123',
});
tag.dispatch();

By default, the hits generated when the Opt-out mode is activated are sent. You can if you wish block these sendings by overloading the Tracker configuration variable sendHitWhenOptOut.

Example

var config = {
    sendHitWhenOptOut: false // true by default
};
var tag = new ATInternet.Tracker.Tag(config);
 

Activating the “No-consent” mode

Activating the no-consent mode of the default authority results in a strictly limited action by the Tracker. See the list of authorized parameters (default):

Example

{
  "include": {
    "storage": [],
    "buffer": [
      "s",
      "idclient",
      "ts",
      "vc",
      "vm"
    ],
    "context": [],
    "properties": []
  }
}

The customer ID then takes the value “Consent-NO” and the generated traffic can be excluded at the analysis level.

Example

var tag = new ATInternet.Tracker.Tag();
tag.privacy.setVisitorMode('default', 'no-consent');
tag.page.set({
    name: 'pageName',
    chapter1: 'chap1',
    chapter2: 'chap2',
    chapter3: 'chap3',
    level2: '123',
});
tag.dispatch();
 

Activating the “Random” mode

Activating the random mode of the default authority results in a strictly limited action by the Tracker. See the list of authorized parameters (default):

{
  "include": {
    "storage": [],
    "buffer": [
      "s",
      "idclient",
      "p",
      "vtag",
      "ptag",
      "ts",
      "vc",
      "vm",
      "ref",
      "xto"
    ],
    "context": [
      {
        "page": [
          "chapter1",
          "chapter2",
          "chapter3",
          "name"
        ]
      },
      "campaigns"
    ],
    "properties": []
  }
}

The customer ID is well defined in the form of a GUID but this is not kept to avoid any reconciliation. Each page loading will therefore result in a change of value of the customer ID.

Example

var tag = new ATInternet.Tracker.Tag();
tag.privacy.setVisitorRandomID();
tag.page.set({
    name: 'pageName',
    chapter1: 'chap1',
    chapter2: 'chap2',
    chapter3: 'chap3',
    level2: '123',
});
tag.dispatch();
 

Activating the “Opt-in” mode

The activation of the default authority optin mode results in an exhaustive measurement by the Tracker. All parameters are then stored and sent. This method has to be called after an Internet user has given his consent.

Example

var tag = new ATInternet.Tracker.Tag();
tag.privacy.setVisitorOptin();
tag.page.set({
    name: 'pageName',
    chapter1: 'chap1',
    chapter2: 'chap2',
    chapter3: 'chap3',
    level2: '123',
});
tag.dispatch();
 

Advanced tagging

 

Priority management

Please note that each activation of a visitor mode, by a call to the dedicated method, leads to a reset of the Tracker context. It is therefore important to condition a call according to your tagging needs and not to execute it systematically. A test on the authority getAuthority() and the mode getVisitorMode() will allow you at any time to choose the best behaviour to adopt.

 

Declaration of a customised authority

You can, if necessary, add a customised authority if the rules already present do not seem sufficient to you. To do this, however, you must know the structure of an object authority:

// Declaration of authority
var authority = {
    "name": "authority",  // Mandatory
    "visitorMode": {
        "name": "visitorMode",  // Mandatory
        "storageDuration": 397,  // Mandatory
        "trackerSettings": {
            "disableStorage": false,
            "disableCookie": false
        },
        "add": { // Parameters to add
            "buffer": {
                "visitorConsent": { // Mandatory
                    "param": "vc",
                    "value": false // true|false
                },
                "visitorMode": { // Mandatory
                    "param": "vm",
                    "value": "visitorMode"
                }
            }
        },
        "include": { // Parameters to include
            "storage": [],
            "buffer": [],
            "context": []
        }
    }
};

Example of tagging a customised authority

// Declaration of custom authority
var customAuthority = {
    "name": "customAuthority",
    "customMode": {
        "name": "customMode",
        "storageDuration": 397,
        "add": {
            "buffer": {
                "visitorConsent": {
                    "param": "vc",
                    "value": false
                },
                "visitorMode": {
                    "param": "vm",
                    "value": "customMode"
                }
            }
        },
        "include": {
            "storage": [
                {
                    "atidvisitor": ["an"] // "an" parameter will be allowed in storage (identified visitor)
                },
                {
                    "atredir": ["an"] // "an" parameter will be allowed for redirections (identified visitor)
                }
            ],
            "buffer": [
                "an", // "an" parameter will be allowed in buffer (identified visitor)
                "x1", // "x1" parameter will be allowed in buffer"
                {
                    "events": [
                        "name", // The event property "name" will be allowed in buffer
                        "data_av_author" // The event property "data_av_author" will be allowed in buffer
                    ],
                    "stc": "author" // The "stc" property "author" will be allowed in buffer
                }
            ]
        }
    }
};
var tag = new ATInternet.Tracker.Tag();
tag.privacy.addAuthority(customAuthority); // Adding custom authority
tag.privacy.setVisitorMode('customAuthority', 'customMode'); // Activation of the custom visitor mode "customMode" of the custom authority "customAuthority"
tag.page.set({
    name: 'pageName',
    chapter1: 'chap1',
    chapter2: 'chap2',
    chapter3: 'chap3',
    level2: '123',
});
tag.dispatch();
Last update: 06/11/2020