Merge branch 'master' into display-cta-accept-all-with-highPrivacy
This commit is contained in:
commit
b43cbce36b
|
|
@ -63,6 +63,7 @@ Bonus:
|
||||||
* Marketing Automation & CRM
|
* Marketing Automation & CRM
|
||||||
* Mautic
|
* Mautic
|
||||||
* Webmecanik Automation
|
* Webmecanik Automation
|
||||||
|
* Koban
|
||||||
|
|
||||||
* Social network
|
* Social network
|
||||||
* AddThis
|
* AddThis
|
||||||
|
|
@ -117,6 +118,7 @@ In PHP for example, you can bypass all the script by setting this var `tarteauci
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
tarteaucitron.init({
|
tarteaucitron.init({
|
||||||
"hashtag": "#tarteaucitron", /* Ouverture automatique du panel avec le hashtag */
|
"hashtag": "#tarteaucitron", /* Ouverture automatique du panel avec le hashtag */
|
||||||
|
"cookieName": "tartaucitron", /* Nom du cookie */
|
||||||
"highPrivacy": false, /* désactiver le consentement implicite (en naviguant) ? */
|
"highPrivacy": false, /* désactiver le consentement implicite (en naviguant) ? */
|
||||||
"AcceptAllCta" : false, /* Afficher le CTA "Tout accepter" si "hightPrivacy : true" */
|
"AcceptAllCta" : false, /* Afficher le CTA "Tout accepter" si "hightPrivacy : true" */
|
||||||
"orientation": "top", /* le bandeau doit être en haut (top) ou en bas (bottom) ? */
|
"orientation": "top", /* le bandeau doit être en haut (top) ou en bas (bottom) ? */
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,13 @@ var scripts = document.getElementsByTagName('script'),
|
||||||
alreadyLaunch = (alreadyLaunch === undefined) ? 0 : alreadyLaunch,
|
alreadyLaunch = (alreadyLaunch === undefined) ? 0 : alreadyLaunch,
|
||||||
tarteaucitronForceLanguage = (tarteaucitronForceLanguage === undefined) ? '' : tarteaucitronForceLanguage,
|
tarteaucitronForceLanguage = (tarteaucitronForceLanguage === undefined) ? '' : tarteaucitronForceLanguage,
|
||||||
tarteaucitronForceExpire = (tarteaucitronForceExpire === undefined) ? '' : tarteaucitronForceExpire,
|
tarteaucitronForceExpire = (tarteaucitronForceExpire === undefined) ? '' : tarteaucitronForceExpire,
|
||||||
|
tarteaucitronCustomText = (tarteaucitronCustomText === undefined) ? '' : tarteaucitronCustomText,
|
||||||
timeExipre = 31536000000,
|
timeExipre = 31536000000,
|
||||||
tarteaucitronProLoadServices,
|
tarteaucitronProLoadServices,
|
||||||
tarteaucitronNoAdBlocker = false;
|
tarteaucitronNoAdBlocker = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var tarteaucitron = {
|
var tarteaucitron = {
|
||||||
"version": 323,
|
"version": 323,
|
||||||
"cdn": cdn,
|
"cdn": cdn,
|
||||||
|
|
@ -181,6 +184,7 @@ var tarteaucitron = {
|
||||||
defaults = {
|
defaults = {
|
||||||
"adblocker": false,
|
"adblocker": false,
|
||||||
"hashtag": '#tarteaucitron',
|
"hashtag": '#tarteaucitron',
|
||||||
|
"cookieName": 'tarteaucitron',
|
||||||
"highPrivacy": false,
|
"highPrivacy": false,
|
||||||
"orientation": "top",
|
"orientation": "top",
|
||||||
"removeCredit": false,
|
"removeCredit": false,
|
||||||
|
|
@ -210,6 +214,10 @@ var tarteaucitron = {
|
||||||
|
|
||||||
// Step 2: load language and services
|
// Step 2: load language and services
|
||||||
tarteaucitron.addScript(pathToLang, '', function () {
|
tarteaucitron.addScript(pathToLang, '', function () {
|
||||||
|
|
||||||
|
if(tarteaucitronCustomText !== ''){
|
||||||
|
tarteaucitron.lang = tarteaucitron.AddOrUpdate(tarteaucitron.lang, tarteaucitronCustomText);
|
||||||
|
}
|
||||||
tarteaucitron.addScript(pathToServices, '', function () {
|
tarteaucitron.addScript(pathToServices, '', function () {
|
||||||
|
|
||||||
var body = document.body,
|
var body = document.body,
|
||||||
|
|
@ -277,6 +285,7 @@ var tarteaucitron = {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defaults.highPrivacy && !defaults.AcceptAllCta) {
|
if (defaults.highPrivacy && !defaults.AcceptAllCta) {
|
||||||
|
|
||||||
html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
|
html += '<div id="tarteaucitronAlertBig" class="tarteaucitronAlertBig' + orientation + '">';
|
||||||
html += ' <span id="tarteaucitronDisclaimerAlert">';
|
html += ' <span id="tarteaucitronDisclaimerAlert">';
|
||||||
html += ' ' + tarteaucitron.lang.alertBigPrivacy;
|
html += ' ' + tarteaucitron.lang.alertBigPrivacy;
|
||||||
|
|
@ -887,7 +896,7 @@ var tarteaucitron = {
|
||||||
expireTime = time + timeExipre, // 365 days
|
expireTime = time + timeExipre, // 365 days
|
||||||
regex = new RegExp("!" + key + "=(wait|true|false)", "g"),
|
regex = new RegExp("!" + key + "=(wait|true|false)", "g"),
|
||||||
cookie = tarteaucitron.cookie.read().replace(regex, ""),
|
cookie = tarteaucitron.cookie.read().replace(regex, ""),
|
||||||
value = 'tarteaucitron=' + cookie + '!' + key + '=' + status,
|
value = tarteaucitron.parameters.cookieName + '=' + cookie + '!' + key + '=' + status,
|
||||||
domain = (tarteaucitron.parameters.cookieDomain !== undefined && tarteaucitron.parameters.cookieDomain !== '') ? 'domain=' + tarteaucitron.parameters.cookieDomain + ';' : '';
|
domain = (tarteaucitron.parameters.cookieDomain !== undefined && tarteaucitron.parameters.cookieDomain !== '') ? 'domain=' + tarteaucitron.parameters.cookieDomain + ';' : '';
|
||||||
|
|
||||||
if (tarteaucitron.cookie.read().indexOf(key + '=' + status) === -1) {
|
if (tarteaucitron.cookie.read().indexOf(key + '=' + status) === -1) {
|
||||||
|
|
@ -899,7 +908,7 @@ var tarteaucitron = {
|
||||||
},
|
},
|
||||||
"read": function () {
|
"read": function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
var nameEQ = "tarteaucitron=",
|
var nameEQ = tarteaucitron.parameters.cookieName + "=",
|
||||||
ca = document.cookie.split(';'),
|
ca = document.cookie.split(';'),
|
||||||
i,
|
i,
|
||||||
c;
|
c;
|
||||||
|
|
@ -1286,5 +1295,18 @@ var tarteaucitron = {
|
||||||
}
|
}
|
||||||
|
|
||||||
tarteaucitron.cookie.number();
|
tarteaucitron.cookie.number();
|
||||||
|
},
|
||||||
|
"AddOrUpdate" : function(source, custom){
|
||||||
|
/**
|
||||||
|
Utility function to Add or update the fields of obj1 with the ones in obj2
|
||||||
|
*/
|
||||||
|
for(key in custom){
|
||||||
|
if(custom[key] instanceof Object){
|
||||||
|
source[key] = tarteaucitron.AddOrUpdate(source[key], custom[key]);
|
||||||
|
}else{
|
||||||
|
source[key] = custom[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return source;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -711,7 +711,7 @@ tarteaucitron.services.facebook = {
|
||||||
"cookies": [],
|
"cookies": [],
|
||||||
"js": function () {
|
"js": function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
tarteaucitron.fallback(['fb-post', 'fb-follow', 'fb-activity', 'fb-send', 'fb-share-button', 'fb-like'], '');
|
tarteaucitron.fallback(['fb-post', 'fb-follow', 'fb-activity', 'fb-send', 'fb-share-button', 'fb-like', 'fb-video'], '');
|
||||||
tarteaucitron.addScript('//connect.facebook.net/' + tarteaucitron.getLocale() + '/sdk.js#xfbml=1&version=v2.0', 'facebook-jssdk');
|
tarteaucitron.addScript('//connect.facebook.net/' + tarteaucitron.getLocale() + '/sdk.js#xfbml=1&version=v2.0', 'facebook-jssdk');
|
||||||
if (tarteaucitron.isAjax === true) {
|
if (tarteaucitron.isAjax === true) {
|
||||||
if (typeof FB !== "undefined") {
|
if (typeof FB !== "undefined") {
|
||||||
|
|
@ -722,7 +722,7 @@ tarteaucitron.services.facebook = {
|
||||||
"fallback": function () {
|
"fallback": function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
var id = 'facebook';
|
var id = 'facebook';
|
||||||
tarteaucitron.fallback(['fb-post', 'fb-follow', 'fb-activity', 'fb-send', 'fb-share-button', 'fb-like'], tarteaucitron.engage(id));
|
tarteaucitron.fallback(['fb-post', 'fb-follow', 'fb-activity', 'fb-send', 'fb-share-button', 'fb-like', 'fb-video'], tarteaucitron.engage(id));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -1073,7 +1073,7 @@ tarteaucitron.services.gtag = {
|
||||||
"use strict";
|
"use strict";
|
||||||
window.dataLayer = window.dataLayer || [];
|
window.dataLayer = window.dataLayer || [];
|
||||||
tarteaucitron.addScript('https://www.googletagmanager.com/gtag/js?id=' + tarteaucitron.user.gtagUa, '', function () {
|
tarteaucitron.addScript('https://www.googletagmanager.com/gtag/js?id=' + tarteaucitron.user.gtagUa, '', function () {
|
||||||
function gtag(){dataLayer.push(arguments);}
|
window.gtag = function gtag(){dataLayer.push(arguments);}
|
||||||
gtag('js', new Date());
|
gtag('js', new Date());
|
||||||
gtag('config', tarteaucitron.user.gtagUa);
|
gtag('config', tarteaucitron.user.gtagUa);
|
||||||
|
|
||||||
|
|
@ -1103,7 +1103,13 @@ tarteaucitron.services.googlemaps = {
|
||||||
tarteaucitron.user.mapscallback = 'tac_googlemaps_callback';
|
tarteaucitron.user.mapscallback = 'tac_googlemaps_callback';
|
||||||
}
|
}
|
||||||
|
|
||||||
tarteaucitron.addScript('//maps.googleapis.com/maps/api/js?v=3.exp&key=' + tarteaucitron.user.googlemapsKey + '&callback='+tarteaucitron.user.mapscallback);
|
// Add Google Maps libraries if any (https://developers.google.com/maps/documentation/javascript/libraries)
|
||||||
|
var googleMapsLibraries = '';
|
||||||
|
if (tarteaucitron.user.googlemapsLibraries) {
|
||||||
|
googleMapsLibraries = '&libraries=' + tarteaucitron.user.googlemapsLibraries;
|
||||||
|
}
|
||||||
|
|
||||||
|
tarteaucitron.addScript('//maps.googleapis.com/maps/api/js?v=3.exp&key=' + tarteaucitron.user.googlemapsKey + '&callback='+tarteaucitron.user.mapscallback + googleMapsLibraries);
|
||||||
|
|
||||||
window.tac_googlemaps_callback = function () {
|
window.tac_googlemaps_callback = function () {
|
||||||
tarteaucitron.fallback(['googlemaps-canvas'], function (x) {
|
tarteaucitron.fallback(['googlemaps-canvas'], function (x) {
|
||||||
|
|
@ -2192,7 +2198,7 @@ tarteaucitron.services.multiplegtag = {
|
||||||
tarteaucitron.user.multiplegtagUa.forEach(function(ua) {
|
tarteaucitron.user.multiplegtagUa.forEach(function(ua) {
|
||||||
|
|
||||||
tarteaucitron.addScript('https://www.googletagmanager.com/gtag/js?id=' + ua, '', function () {
|
tarteaucitron.addScript('https://www.googletagmanager.com/gtag/js?id=' + ua, '', function () {
|
||||||
function gtag(){dataLayer.push(arguments);}
|
window.gtag = function gtag(){dataLayer.push(arguments);}
|
||||||
gtag('js', new Date());
|
gtag('js', new Date());
|
||||||
gtag('config', ua);
|
gtag('config', ua);
|
||||||
});
|
});
|
||||||
|
|
@ -2200,3 +2206,70 @@ tarteaucitron.services.multiplegtag = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Koban
|
||||||
|
tarteaucitron.services.koban = {
|
||||||
|
"key": "koban",
|
||||||
|
"type": "analytic",
|
||||||
|
"name": "Koban",
|
||||||
|
"uri": "https://koban.cloud/tos",
|
||||||
|
"needConsent": true,
|
||||||
|
"cookies": ['kbntrk'],
|
||||||
|
"js": function () {
|
||||||
|
"use strict";
|
||||||
|
if (tarteaucitron.user.kobanurl === undefined) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (tarteaucitron.user.kobanapi === undefined) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.KobanObject = 'kb';
|
||||||
|
window.kb = window.kb || function() {
|
||||||
|
window.kb.q = window.kb.q || [];
|
||||||
|
window.kb.q.push(arguments);
|
||||||
|
};
|
||||||
|
window.kb.l = new Date();
|
||||||
|
kb('reg', tarteaucitron.user.kobanapi);
|
||||||
|
tarteaucitron.addScript(tarteaucitron.user.kobanurl, '', function() {
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// matomo
|
||||||
|
|
||||||
|
/*
|
||||||
|
1. Set the following variable before the initialization :
|
||||||
|
|
||||||
|
tarteaucitron.user.matomoId = YOUR_SITE_ID_FROM_MATOMO;
|
||||||
|
tarteaucitron.user.matomoHost = "YOUR_MATOMO_URL"; //eg: https://stat.mydomain.com/
|
||||||
|
|
||||||
|
2. Push the service :
|
||||||
|
|
||||||
|
(tarteaucitron.job = tarteaucitron.job || []).push('matomo');
|
||||||
|
|
||||||
|
3. HTML
|
||||||
|
You don't need to add any html code, if the service is autorized, the javascript is added. otherwise no.
|
||||||
|
*/
|
||||||
|
tarteaucitron.services.matomo = {
|
||||||
|
"key": "matomo",
|
||||||
|
"type": "analytic",
|
||||||
|
"name": "Matomo (formerly known as Piwik)",
|
||||||
|
"uri": "https://matomo.org/faq/general/faq_146/",
|
||||||
|
"needConsent": true,
|
||||||
|
"cookies": ['_pk_ref', '_pk_cvar', '_pk_id', '_pk_ses', '_pk_hsr', 'piwik_ignore', '_pk_uid'],
|
||||||
|
"js": function () {
|
||||||
|
"use strict";
|
||||||
|
if (tarteaucitron.user.matomoId === undefined) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
window._paq = window._paq || [];
|
||||||
|
window._paq.push(["setSiteId", tarteaucitron.user.matomoId]);
|
||||||
|
window._paq.push(["setTrackerUrl", tarteaucitron.user.matomoHost + "piwik.php"]);
|
||||||
|
window._paq.push(["setDoNotTrack", 1]);
|
||||||
|
window._paq.push(["trackPageView"]);
|
||||||
|
window._paq.push(["setIgnoreClasses", ["no-tracking", "colorbox"]]);
|
||||||
|
window._paq.push(["enableLinkTracking"]);
|
||||||
|
|
||||||
|
tarteaucitron.addScript(tarteaucitron.user.matomoHost + 'piwik.js', '', '', true, 'defer', true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue