From 1b5f0cad472e3724eb63cb1b37a71002459eb3f6 Mon Sep 17 00:00:00 2001 From: Hugo Heneault Date: Fri, 14 Sep 2018 11:55:41 +0200 Subject: [PATCH 1/5] =?UTF-8?q?=E2=9C=A8=20Add=20Google=20Maps=20Iframe=20?= =?UTF-8?q?embed=20service?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tarteaucitron.js | 6 ++++++ tarteaucitron.services.js | 29 +++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/tarteaucitron.js b/tarteaucitron.js index 8108076..36985f1 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -1447,5 +1447,11 @@ var tarteaucitron = { } } return source; + }, + "getElemWidth": function(elem) { + return elem.getAttribute('width') || elem.clientWidth; + }, + "getElemHeight": function(elem) { + return elem.getAttribute('height') || elem.clientHeight; } }; diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index f5096b2..1c46b4f 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -1191,6 +1191,35 @@ tarteaucitron.services.googlemapssearch = { } }; +// googlemaps embed iframe +tarteaucitron.services.googlemapsembed = { + "key": "googlemapsembed", + "type": "api", + "name": "Google Maps Embed", + "uri": "http://www.google.com/ads/preferences/", + "needConsent": true, + "cookies": ['apisid', 'hsid', 'nid', 'sapisid', 'sid', 'sidcc', 'ssid', '1p_jar'], + "js": function () { + "use strict"; + tarteaucitron.fallback(['googlemapsembed'], function (x) { + var width = tarteaucitron.getElemWidth(x), + height = tarteaucitron.getElemHeight(x), + url = x.getAttribute("data-url"); + + return ''; + }); + }, + "fallback": function () { + "use strict"; + var id = 'googlemapsembed'; + tarteaucitron.fallback(['googlemapsembed'], function (elem) { + elem.style.width = tarteaucitron.getElemWidth(elem) + 'px'; + elem.style.height = tarteaucitron.getElemHeight(elem) + 'px'; + return tarteaucitron.engage(id); + }); + } +}; + // google tag manager tarteaucitron.services.googletagmanager = { "key": "googletagmanager", From 6614bd008a4e52ced4ede2c0d4de67186e3ed462 Mon Sep 17 00:00:00 2001 From: Amauri CHAMPEAUX Date: Tue, 25 Sep 2018 12:30:02 +0200 Subject: [PATCH 2/5] Add Adform and Active Campaign --- tarteaucitron.services.js | 44 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index 850cb35..07392fe 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -2338,3 +2338,47 @@ tarteaucitron.services.bingads = { }); } }; + +// Adform +tarteaucitron.services.adform = { + "key": "adform", + "type": "ads", + "name": "Adform", + "uri": "https://site.adform.com/privacy-center/overview/", + "needConsent": true, + "cookies": [], + "js": function () { + "use strict"; + if (tarteaucitron.user.adformpm === undefined) { + return; + } + + window._adftrack = { + pm: tarteaucitron.user.adformpm, + divider: encodeURIComponent('|'), + pagename: encodeURIComponent('WebsiteName|SectionName|SubSection|PageName') + }; + + tarteaucitron.addScript("https://track.adform.net/serving/scripts/trackpoint/async/"); + } +}; + +// Active Campaign +tarteaucitron.services.activecampaign = { + "key": "activecampaign", + "type": "ads", + "name": "Active Campaign", + "uri": "https://www.activecampaign.com/privacy-policy/", + "needConsent": true, + "cookies": [], + "js": function () { + "use strict"; + if (tarteaucitron.user.actid === undefined) { + return; + } + + window.trackcmp_email = ''; + + tarteaucitron.addScript('https://trackcmp.net/visit?actid='+tarteaucitron.user.actid+'&e='+encodeURIComponent(trackcmp_email)+'&r='+encodeURIComponent(document.referrer)+'&u='+encodeURIComponent(window.location.href)); + } +}; From 5753a54194d2d73b56b2933256991191c7507455 Mon Sep 17 00:00:00 2001 From: Vincent MARMIESSE Date: Tue, 25 Sep 2018 14:14:44 +0200 Subject: [PATCH 3/5] Add Adform page name --- tarteaucitron.services.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index 07392fe..0ca7b48 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -2349,14 +2349,14 @@ tarteaucitron.services.adform = { "cookies": [], "js": function () { "use strict"; - if (tarteaucitron.user.adformpm === undefined) { + if (tarteaucitron.user.adformpm === undefined || tarteaucitron.user.adformpagename === undefined) { return; } window._adftrack = { pm: tarteaucitron.user.adformpm, divider: encodeURIComponent('|'), - pagename: encodeURIComponent('WebsiteName|SectionName|SubSection|PageName') + pagename: encodeURIComponent(tarteaucitron.user.adformpagename) }; tarteaucitron.addScript("https://track.adform.net/serving/scripts/trackpoint/async/"); From 35945880892fbcb3e3802560278257d4b31e4f73 Mon Sep 17 00:00:00 2001 From: Amauri CHAMPEAUX Date: Tue, 25 Sep 2018 14:21:20 +0200 Subject: [PATCH 4/5] Add parameters to Adform --- tarteaucitron.services.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index 07392fe..d5a551f 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -2349,14 +2349,14 @@ tarteaucitron.services.adform = { "cookies": [], "js": function () { "use strict"; - if (tarteaucitron.user.adformpm === undefined) { + if (tarteaucitron.user.adformpm === undefined || tarteaucitron.user.adformWebsiteName === undefined || tarteaucitron.user.adformSectionName === undefined || tarteaucitron.user.adformSubSection === undefined || tarteaucitron.user.adformPageName === undefined) { return; } window._adftrack = { pm: tarteaucitron.user.adformpm, divider: encodeURIComponent('|'), - pagename: encodeURIComponent('WebsiteName|SectionName|SubSection|PageName') + pagename: encodeURIComponent(tarteaucitron.user.adformWebsiteName+'|'+tarteaucitron.user.adformSectionName+'|'+tarteaucitron.user.adformSubSection+'|'+tarteaucitron.user.adformPageName) }; tarteaucitron.addScript("https://track.adform.net/serving/scripts/trackpoint/async/"); From 0bbe60633d32789ef31e1608c83b8ec443446417 Mon Sep 17 00:00:00 2001 From: Amauri CHAMPEAUX Date: Wed, 26 Sep 2018 12:07:02 +0200 Subject: [PATCH 5/5] Add Tawk.to --- tarteaucitron.services.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index 52cacd6..1d8bd78 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -2412,3 +2412,24 @@ tarteaucitron.services.activecampaign = { tarteaucitron.addScript('https://trackcmp.net/visit?actid='+tarteaucitron.user.actid+'&e='+encodeURIComponent(trackcmp_email)+'&r='+encodeURIComponent(document.referrer)+'&u='+encodeURIComponent(window.location.href)); } }; + +// tawk.to +tarteaucitron.services.tawkto = { + "key": "tawkto", + "type": "support", + "name": "Tawk.to chat", + "uri": "https://www.tawk.to/data-protection/", + "needConsent": true, + "cookies": [], + "js": function () { + "use strict"; + if (tarteaucitron.user.tawktoId === undefined) { + return; + } + + window.Tawk_API=window.Tawk_API||{}; + window.Tawk_LoadStart=new Date(); + + tarteaucitron.addScript('https://embed.tawk.to/' + tarteaucitron.user.tawktoId + '/default'); + } +};