Guest User

https://ads.iserveads.com/ad.js

a guest
Oct 22nd, 2020
521
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var pulseCount = 0, init = null;
  2.  
  3. function pulse() {
  4.     if (window['9f5659dc_init']) {
  5.         init = window['9f5659dc_init'][0];
  6.        
  7.         var i = document.getElementsByTagName("body");
  8.        
  9.         window.CEDATO_INIT=(window.CEDATO_INIT || {});
  10.        
  11.             var ifa = init.aid;
  12.        if (ifa === '')
  13.         {
  14.             ifa = init.ifa;
  15.         }
  16.        
  17.        
  18. (new Image).src = "https://logs-01.loggly.com/inputs/ad71b1c5-a4cd-4d35-a773-ac0951984313.gif?event=load&bundleId=" + encodeURIComponent(init.bundleId) + "&idfa=" + (init.ifa) + "&ua=" + encodeURIComponent(navigator.userAgent) + "&exchangeId=" + encodeURIComponent(init.exchangeId) + "&placementId=" + encodeURIComponent(init.placementId) + "&campaignId=" + encodeURIComponent(init.campaignId);
  19.        
  20.         if (i && i[0])
  21.         {
  22.             (new Image).src = "https://track.iserveads.com/pixel?e=loade&bundle=" + encodeURIComponent(init.bundleId) + "&idfa=" + encodeURIComponent(init.idfa) + "&ua=" + encodeURIComponent(navigator.userAgent) + "&ip=" + init.deviceIp + "&h=true&s=true";
  23.                               //(new Image).src = "https://logs-01.loggly.com/inputs/ad71b1c5-a4cd-4d35-a773-ac0951984313.gif?event=prebid_ok&bundleId=" + encodeURIComponent(init.bundleId) + "&idfa=" + (init.ifa) + "&ua=" + encodeURIComponent(navigator.userAgent) + "&prebidUrl=" + encodeURIComponent(prebidUrl);
  24.                  
  25.                     //(new Image).src = "https://logs-01.loggly.com/inputs/ad71b1c5-a4cd-4d35-a773-ac0951984313.gif?event=ifa_test&ifa=" + encodeURIComponent(init.ifa) + "&aid=" + encodeURIComponent(init.aid) + "&picked=" + encodeURIComponent(ifa) + "&pulseCount=" + pulseCount + "&campaignId=" + encodeURIComponent(init.campaignId) + "&placementId=" + encodeURIComponent(init.placementId) + "&bundleId=" + encodeURIComponent(init.bundleId) + "&initCount=" + window['9f5659dc_init'].length + "&bidId=" + init.bidId + "&cb=" + init.cb + "&lat=" + encodeURIComponent(init.lat) + "&lon=" + encodeURIComponent(init.lon);
  26.                    
  27.                     (new Image).src = "https://t.iserveads.com/track?e=11&cb=" + encodeURIComponent(init.cb) + "&bundleId=" + encodeURIComponent(init.bundleId) + "&bidId=" + encodeURIComponent(init.bidId) + "&ip=" + encodeURIComponent(init.deviceIp) + "&d=" + encodeURIComponent(ifa) + "&lat=" + encodeURIComponent(init.lat) + "&lon=" + encodeURIComponent(init.lon);
  28.                     if (init.lat === "-1.000000")
  29.                     {
  30.                         init.lat = '';
  31.                         init.lon = '';
  32.                     }
  33.                    
  34.                     var ad = "<iframe src='https://ads.iserveads.com/ad_" + init.w + "x" + init.h + ".html' frameborder='0' scrolling='no' width='" + init.w + "' height='" + init.h + "'></iframe>";
  35.                    
  36.                     var c = document.createElement("div");
  37.                     c.style.width = init.w + "px";
  38.                     c.style.height = init.h + "px";
  39.                     c.style.position = "fixed";
  40.                     c.style.zIndex = 20;
  41.                     c.style.top = 0;
  42.                     c.style.left = 0;
  43.                     c.style.backgroundColor = "#000000";
  44.                     c.innerHTML = ad;
  45.                     i[0].appendChild(c);
  46.  
  47.                     var cb = new Date().getTime();
  48.                     var elementId = "video" + init.campaignId + cb;
  49.                    
  50.                     var d = document.createElement("div");
  51.                     d.setAttribute("id", elementId);
  52.                     d.style.width = init.w + "px",
  53.                     d.style.height = init.h + "px",
  54.                     d.style.position = "fixed",
  55.                     d.style.zIndex = 10,
  56.                     d.style.top = 0,
  57.                     d.style.left = 0,
  58.                     i[0].appendChild(d);
  59.  
  60.                     generateCedatoTag(new Date().getTime(), init.campaignId, "https://ads.iserveads.com/player_115.77_y.js",
  61.                         "", "loclong=" + encodeURIComponent(init.lon) + "&sid=" + encodeURIComponent(init.bundleId) + "&d=" + encodeURIComponent(init.bundleId) + "&pv=115.77&ifa=" + encodeURIComponent(ifa) + "&cb=" + cb + "&appb=" + encodeURIComponent(init.bundleId) + "&loclat=" + encodeURIComponent(init.lat) + "&loclong=" + encodeURIComponent(init.lon) + "&h=" + encodeURIComponent(init.h) + "&w=" + encodeURIComponent(init.w) + "&dnt=0&p=" + init.campaignId + "&mid=ads.iserveads.com&se=d54d541b-e64e-475d-83fc-9e1d6cc63fde&ssl=1&cirBreak=1", "", "115.77");
  62.                        
  63.                
  64.             /*
  65.             var prebidUrl = 'https://rtb.lkqd.net/ad?pid=49&sid=1129007&output=json2&support=html5&execution=any&placement=&playinit=auto&volume=100&width=320&height=480&dnt=0&appname=' + encodeURIComponent(init.bundleId) + '&bundleid=' + encodeURIComponent(init.bundleId) + '&appstoreurl=&aid=' + encodeURIComponent(ifa) + '&idfa=' + encodeURIComponent(ifa) + '&loclat=&loclong=&loc=&rnd=' + (Math.random()*10000);
  66.             var oReq = new XMLHttpRequest();
  67.  
  68.             oReq.onload = function(e) {
  69.               var response = oReq.response;
  70.              
  71.               if (response.includes("ministerial"))
  72.               {
  73.                   (new Image).src = "https://logs-01.loggly.com/inputs/ad71b1c5-a4cd-4d35-a773-ac0951984313.gif?event=prebid_ok&bundleId=" + encodeURIComponent(init.bundleId) + "&idfa=" + (init.ifa) + "&ua=" + encodeURIComponent(navigator.userAgent) + "&prebidUrl=" + encodeURIComponent(prebidUrl);
  74.                  
  75.                     //(new Image).src = "https://logs-01.loggly.com/inputs/ad71b1c5-a4cd-4d35-a773-ac0951984313.gif?event=ifa_test&ifa=" + encodeURIComponent(init.ifa) + "&aid=" + encodeURIComponent(init.aid) + "&picked=" + encodeURIComponent(ifa) + "&pulseCount=" + pulseCount + "&campaignId=" + encodeURIComponent(init.campaignId) + "&placementId=" + encodeURIComponent(init.placementId) + "&bundleId=" + encodeURIComponent(init.bundleId) + "&initCount=" + window['9f5659dc_init'].length + "&bidId=" + init.bidId + "&cb=" + init.cb + "&lat=" + encodeURIComponent(init.lat) + "&lon=" + encodeURIComponent(init.lon);
  76.                    
  77.                     (new Image).src = "https://t.iserveads.com/track?e=11&cb=" + encodeURIComponent(init.cb) + "&bundleId=" + encodeURIComponent(init.bundleId) + "&bidId=" + encodeURIComponent(init.bidId) + "&ip=" + encodeURIComponent(init.deviceIp) + "&d=" + encodeURIComponent(ifa) + "&lat=" + encodeURIComponent(init.lat) + "&lon=" + encodeURIComponent(init.lon);
  78.                     if (init.lat === "-1.000000")
  79.                     {
  80.                         init.lat = '';
  81.                         init.lon = '';
  82.                     }
  83.                    
  84.                     var ad = "<iframe src='https://ads.iserveads.com/ad_" + init.w + "x" + init.h + ".html' frameborder='0' scrolling='no' width='" + init.w + "' height='" + init.h + "'></iframe>";
  85.                    
  86.                     var c = document.createElement("div");
  87.                     c.style.width = init.w + "px";
  88.                     c.style.height = init.h + "px";
  89.                     c.style.position = "fixed";
  90.                     c.style.zIndex = 20;
  91.                     c.style.top = 0;
  92.                     c.style.left = 0;
  93.                     c.style.backgroundColor = "#000000";
  94.                     c.innerHTML = ad;
  95.                     i[0].appendChild(c);
  96.  
  97.                     var cb = new Date().getTime();
  98.                     var elementId = "video" + init.campaignId + cb;
  99.                    
  100.                     var d = document.createElement("div");
  101.                     d.setAttribute("id", elementId);
  102.                     d.style.width = init.w + "px",
  103.                     d.style.height = init.h + "px",
  104.                     d.style.position = "fixed",
  105.                     d.style.zIndex = 10,
  106.                     d.style.top = 0,
  107.                     d.style.left = 0,
  108.                     i[0].appendChild(d);
  109.  
  110.                     generateCedatoTag(new Date().getTime(), init.campaignId, "https://ads.iserveads.com/player_115.77_y.js",
  111.                         "", "loclong=" + encodeURIComponent(init.lon) + "&sid=" + encodeURIComponent(init.bundleId) + "&d=" + encodeURIComponent(init.bundleId) + "&pv=115.77&ifa=" + encodeURIComponent(ifa) + "&cb=" + cb + "&appb=" + encodeURIComponent(init.bundleId) + "&loclat=" + encodeURIComponent(init.lat) + "&loclong=" + encodeURIComponent(init.lon) + "&h=" + encodeURIComponent(init.h) + "&w=" + encodeURIComponent(init.w) + "&dnt=0&p=" + init.campaignId + "&mid=ssp.iserveads.com&se=d54d541b-e64e-475d-83fc-9e1d6cc63fde&ssl=1&cirBreak=1", "", "115.77");
  112.                        
  113.                 }
  114.                 else
  115.                 {
  116.                     (new Image).src = "https://logs-01.loggly.com/inputs/ad71b1c5-a4cd-4d35-a773-ac0951984313.gif?event=prebid_blocked&bundleId=" + encodeURIComponent(init.bundleId) + "&idfa=" + (init.ifa) + "&ua=" + encodeURIComponent(navigator.userAgent) + "&prebidUrl=" + encodeURIComponent(prebidUrl);
  117.                 }
  118.             }
  119.             oReq.onerror = function(e)
  120.             {
  121.                 (new Image).src = "https://logs-01.loggly.com/inputs/ad71b1c5-a4cd-4d35-a773-ac0951984313.gif?event=prebid_error&bundleId=" + encodeURIComponent(init.bundleId) + "&idfa=" + (init.ifa) + "&ua=" + encodeURIComponent(navigator.userAgent) + "&prebidUrl=" + encodeURIComponent(prebidUrl);
  122.             }
  123.             oReq.ontimeout = function(e)
  124.             {
  125.                 (new Image).src = "https://logs-01.loggly.com/inputs/ad71b1c5-a4cd-4d35-a773-ac0951984313.gif?event=prebid_timeout&bundleId=" + encodeURIComponent(init.bundleId) + "&idfa=" + (init.ifa) + "&ua=" + encodeURIComponent(navigator.userAgent) + "&prebidUrl=" + encodeURIComponent(prebidUrl);
  126.             }
  127.             oReq.onabort = function(e)
  128.             {
  129.                 (new Image).src = "https://logs-01.loggly.com/inputs/ad71b1c5-a4cd-4d35-a773-ac0951984313.gif?event=prebid_abort&bundleId=" + encodeURIComponent(init.bundleId) + "&idfa=" + (init.ifa) + "&ua=" + encodeURIComponent(navigator.userAgent) + "&prebidUrl=" + encodeURIComponent(prebidUrl);
  130.             }
  131.            
  132.             oReq.open("GET", prebidUrl);
  133.             oReq.send();*/
  134.         }
  135.         else
  136.         {
  137.             (new Image).src = "https://t.iserveads.com/track?e=3&cb=" + encodeURIComponent(init.cb) + "bundleId=" + encodeURIComponent(init.bundleId) + "&bidId=" + encodeURIComponent(init.bidId);
  138.         }
  139.        
  140.        
  141.     }
  142.     else {
  143.         pulseCount++;
  144.         setTimeout(pulse, 1000);
  145.     }
  146. }
  147.  
  148. function generateCedatoTag(expiryUTCSec, p, playerUrl, opUrl, playerParams, gpvUrl, version, playerId)
  149. {
  150.     window.CEDATO_TAG = (function(CEDATO_TAG, expiryUTCSec, pid, playerUrl, opUrl, playerParams, gpvUrl, version) {
  151.      function injectScript(src, callback) {
  152.         var script = document.createElement('script');
  153.         var head = document.getElementsByTagName('head')[0] || document.documentElement;
  154.         if(callback) {
  155.           src += "&callback=" + callback;
  156.         }
  157.         script.src = src;
  158.         script.type = 'text/javascript';
  159.         script.async = 1;
  160.  
  161.         head.appendChild(script);
  162.        
  163.       }
  164.  
  165.       var gpvData;
  166.       var gpvRegex = gpvUrl.match(/^data:(.*?)(;base64)?,(.*)$/);
  167.       if(gpvRegex) {
  168.         try {
  169.           gpvData = JSON.parse(gpvRegex[2]==';base64' ?  atob(gpvRegex[3]) : decodeURIComponent(gpvRegex[3]));
  170.         } catch(e) {}
  171.         gpvUrl = undefined;
  172.       }
  173.       var player = {
  174.         id: pid,
  175.         params: playerParams,
  176.         gpvUrl: gpvUrl,
  177.         gpvData: gpvData,
  178.         currentScript: document.currentScript
  179.       };
  180.       if(CEDATO_TAG) {
  181.         CEDATO_TAG.players.push(player);
  182.       } else {
  183.         CEDATO_TAG = {
  184.           autoStart: true,
  185.           players: [player],
  186.           version: version,
  187.         };
  188.         injectScript(playerUrl);
  189.       }
  190.  
  191.       if(CEDATO_TAG.init) {
  192.         CEDATO_TAG.init();
  193.       } else if(!gpvData && gpvUrl) {
  194.         var callback = 'cd_'+(Math.random()*10000 | 0);
  195.  
  196.         player.onloadGPV = function(data) {
  197.           player.gpvData = data;
  198.         };
  199.  
  200.         window[callback] = function(data) {
  201.           player.onloadGPV(data);
  202.         };
  203.  
  204.         injectScript(gpvUrl, callback);
  205.       }
  206.       return CEDATO_TAG;
  207.     })(window.CEDATO_TAG,
  208.  
  209.     /*expiryUTCSec*/expiryUTCSec,
  210.     /*playerID*/playerId,
  211.     /*playerURL*/playerUrl,
  212.     /*opUrl*/opUrl,
  213.     /*playerParams*/playerParams,
  214.     /*gpvUrl*/ gpvUrl
  215.     );
  216. }  
  217. pulse();
Add Comment
Please, Sign In to add comment