diff --git a/tarteaucitron.js b/tarteaucitron.js index 4e5d3f2..28a1cf9 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -10,7 +10,7 @@ var scripts = document.getElementsByTagName('script'), tarteaucitronNoAdBlocker = false; var tarteaucitron = { - "version": 317, + "version": 323, "cdn": cdn, "user": {}, "lang": {}, @@ -1080,7 +1080,7 @@ var tarteaucitron = { return 'en_US'; } }, - "addScript": function (url, id, callback, execute) { + "addScript": function (url, id, callback, execute, attrName, attrVal) { "use strict"; var script, done = false; @@ -1095,6 +1095,10 @@ var tarteaucitron = { script.id = (id !== undefined) ? id : ''; script.async = true; script.src = url; + + if (attrName !== undefined && attrVal !== undefined) { + script.setAttribute(attrName, attrVal); + } if (typeof callback === 'function') { script.onreadystatechange = script.onload = function () { diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index e1f862d..653a747 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -461,6 +461,24 @@ tarteaucitron.services.ekomi = { } }; +// etracker +tarteaucitron.services.etracker = { + "key": "etracker", + "type": "analytic", + "name": "eTracker", + "uri": "https://www.etracker.com/en/data-protection.html", + "needConsent": true, + "cookies": [], + "js": function () { + "use strict"; + if (tarteaucitron.user.etracker === undefined) { + return; + } + + tarteaucitron.addScript('//static.etracker.com/code/e.js', '_etLoader', function () {}, true, "data-secure-code", tarteaucitron.user.etracker); + } +}; + // facebook tarteaucitron.services.facebook = { "key": "facebook",