(function () { var revDiv = document.querySelector('script[id="rc_808"]').parentNode; var appendRcel = function(url) { var rcel = document.createElement("script"); rcel.id = 'rc_' + Math.floor(Math.random() * 1000); rcel.type = 'text/javascript'; url += '&criteo=true'; rcel.src = url; rcel.async = true; revDiv.appendChild(rcel); } var callRev_rc_808 = function(response) { var url = '//trends.revcontent.com/serve.js.php?w=96252&t=rc_808&c=1566870681618&width=1024&referer=&is_blocked=false'; url += '&site_url=' + encodeURIComponent(window.location.href.substr(0,700)); try { if(Array.isArray(response)) { response = revMap(response); } else { response = ''; } var rcxhr = new XMLHttpRequest(); rcxhr.onreadystatechange = function() { if (rcxhr.readyState == 4) { var rcel = document.createElement("script"); rcel.type = 'text/javascript'; rcel.text = rcxhr.responseText; rcel.async = true; revDiv.appendChild(rcel); } } rcxhr.open("POST", url, true); rcxhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); rcxhr.withCredentials = true; rcxhr.send('criteo=' + response); rcxhr.onerror = function() { appendRcel(url); } } catch(e) { appendRcel(url); } }; (function () { var pxl = function(data) { var p = document.createElement('img'); p.src = data.src + '&rev_dt=1566870683'; p.style.display = 'none'; revDiv.appendChild(p); if (data.retry) { data.retry--; p.onload = function() { setTimeout(function() { pxl(data); }, 50); }; } }; pxl({ retry: false, src: "https://ib.adnxs.com/getuid?https%3A%2F%2Fcm.revcontent.com%2Fpixel_sync%3Fbidder%3D115%26bidder_uid%3D%24UID%26exchange_uid%3DNjE4MzYwY2E0NzRmZDZhOWJiOGRhMjFlOGU4NGY4MDQ=&geo=35" }); pxl({ retry: false, src: "https://x.bidswitch.net/sync?ssp=revcontent" }); pxl({ retry: false, src: "https://bttrack.com/pixel/cookiesync?source=0b0edea9-c9fe-4b9c-9bcd-a51022f2873f&publisherid=NjE4MzYwY2E0NzRmZDZhOWJiOGRhMjFlOGU4NGY4MDQ=&pushdata=109&secure=1" }); }()); var cs = document.createElement("script"); cs.type = 'text/javascript'; cs.src = "https://static.criteo.net/js/ld/publishertag.js"; cs.async = true; revDiv.appendChild(cs); if(typeof rc_criteo == 'undefined') { var rc_criteo = []; } cs.addEventListener('load', function() { callCriteo_rc_808(); }); function callCriteo_rc_808() { var adUnits = { "placements": [ { 'slotid': 'rev-0', 'zoneid': 1210272, 'nativeCallback': function(){} }, ] }; Criteo.events.push(function() { Criteo.RequestBids(adUnits, callRev_rc_808, 500); }); } function revMap(response) { var final = []; var c = 0; var dupe; response.sort(function(a,b){ return b.cpm - a.cpm }); response.forEach(function(r, index) { dupe = false; if(rc_criteo.indexOf(r.id) != -1) { return; } final.forEach(function(f, i) { if(r.nativePayload.products[0].title == f.headline) { dupe = true; } }); if (!dupe && final.length < 1) { rc_criteo.push(r.id); var headline = r.nativePayload.products[0].title; final[c] = {}; final[c].headline = headline.length > 80 ? headline.substring(0,80) + '...' : headline; final[c].price = r.nativePayload.products[0].price; final[c].target_url = r.nativePayload.products[0].click_url; final[c].image_url = r.nativePayload.products[0].image.url; final[c].cpm = r.cpm; final[c].pixels = []; final[c].advertiser = r.nativePayload.advertiser.description; final[c].optout_click_url = r.nativePayload.privacy.optout_click_url; final[c].optout_image_url = r.nativePayload.privacy.optout_image_url; r.nativePayload.impression_pixels.forEach(function(p, i) { final[c].pixels.push(p.url); }); c++; } }); return encodeURIComponent(JSON.stringify(final)); } })();