diff --git a/tarteaucitron.js b/tarteaucitron.js index db31e29..4e5d3f2 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -10,7 +10,7 @@ var scripts = document.getElementsByTagName('script'), tarteaucitronNoAdBlocker = false; var tarteaucitron = { - "version": 315, + "version": 317, "cdn": cdn, "user": {}, "lang": {}, diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index 62d09c5..e1f862d 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -957,7 +957,7 @@ tarteaucitron.services.prelinker = { tarteaucitron.fallback(['prelinker-canvas'], function (x) { var uniqId = '_' + Math.random().toString(36).substr(2, 9); uniqIds.push(uniqId); - return '
'; + return '
'; }); for (i = 0; i < uniqIds.length; i += 1) { @@ -1092,6 +1092,46 @@ tarteaucitron.services.shareaholic = { } }; +// shareasale +tarteaucitron.services.shareasale = { + "key": "shareasale", + "type": "ads", + "name": "ShareASale", + "uri": "https://www.shareasale.com/PrivacyPolicy.pdf", + "needConsent": true, + "cookies": [], + "js": function () { + "use strict"; + var uniqIds = [], + i, + uri; + + tarteaucitron.fallback(['shareasale-canvas'], function (x) { + var uniqId = '_' + Math.random().toString(36).substr(2, 9); + uniqIds.push(uniqId); + return '
'; + }); + + for (i = 0; i < uniqIds.length; i += 1) { + uri = 'https://shareasale.com/sale.cfm?'; + uri += 'amount=' + document.getElementById(uniqIds[i]).getAttribute('amount') + '&'; + uri += 'tracking=' + document.getElementById(uniqIds[i]).getAttribute('tracking') + '&'; + uri += 'transtype=' + document.getElementById(uniqIds[i]).getAttribute('transtype') + '&'; + uri += 'persale=' + document.getElementById(uniqIds[i]).getAttribute('persale') + '&'; + uri += 'perlead=' + document.getElementById(uniqIds[i]).getAttribute('perlead') + '&'; + uri += 'perhit=' + document.getElementById(uniqIds[i]).getAttribute('perhit') + '&'; + uri += 'merchantID=' + document.getElementById(uniqIds[i]).getAttribute('merchantID'); + + document.getElementById(uniqIds[i]).innerHTML = ''; + } + }, + "fallback": function () { + "use strict"; + var id = 'shareasale'; + tarteaucitron.fallback(['shareasale-canvas'], tarteaucitron.engage(id)); + } +}; + // sharethis tarteaucitron.services.sharethis = { "key": "sharethis",