1 var googletag = window.googletag || { cmd: [] }; 2 googletag.cmd.push(function () { 3 googletag.pubads().collapseEmptyDivs(); 4 googletag.pubads().set('page_url', 'https://www.diariolibre.com'); 5 googletag.pubads().setTargeting('seccion', 'ultima hora'); 6 googletag.pubads().setTargeting('tipocolocacion', 'Estandar'); 7 googletag.enableServices(); 8 if (typeof Storage !== "undefined") { 9 var targetingParamStr = localStorage.getItem("bcDFPTargetingParams"); 10 if (targetingParamStr) { 11 var targetingParameters = JSON.parse(targetingParamStr); 12 for (var i = 0; i < targetingParameters.length - 1; i++) { 13 googletag.pubads().setTargeting(targetingParameters[i].key, targetingParameters[i].value); 14 } 15 } 16 } 17 }); 18 // Catálogo de specs de cada slot, SIN registrarlos todavÃa en GPT 19 var AD_SLOTS_CONFIG = { 20 'dl_160x600_skin_left': { path: '/1659553/dl_160x600_skin_left', sizes: [[160, 600], [120, 600]] }, 21 'dl_160x600_skin_right': { path: '/1659553/dl_160x600_skin_right', sizes: [[160, 600], [120, 600]] }, 22 'dl_970x250_1': { path: '/1659553/dl_970x250_1', sizes: [970, 90] }, 23 'dl_970x250_2': { path: '/1659553/dl_970x250_2', sizes: [[728, 90], [970, 250], [970, 90]] }, 24 'dl_300x600_1': { path: '/1659553/dl_300x600_1', sizes: [300, 600] }, 25 'dl_1x1': { path: '/1659553/dl_1x1', sizes: [1, 1], noRefresh: true }, 26 'dl_1x1_internacional': { path: '/1659553/dl_1x1_internacional', sizes: [1, 1], noRefresh: true }, 27 'dl_970x600': { path: '/1659553/dl_970x600', sizes: [970, 600] }, 28 'dl_300x600_2': { path: '/1659553/dl_300x600_2', sizes: [300, 600] } 29 }; 30 var REFRESH_KEY = 'refresh'; 31 var REFRESH_VALUE = 'true'; 32 var SECONDS_TO_WAIT_AFTER_VIEWABILITY = 30; 33 var definedSlots = {}; 34 function defineAndDisplaySlot(slotId) { 35 if (definedSlots[slotId]) return; 36 var config = AD_SLOTS_CONFIG[slotId]; 37 if (!config) return; 38 googletag.cmd.push(function () { 39 var slot = googletag.defineSlot(config.path, config.sizes, slotId) 40 .setTargeting(REFRESH_KEY, REFRESH_VALUE) 41 .addService(googletag.pubads()); 42 if (config.targeting) { 43 for (var key in config.targeting) { 44 slot.setTargeting(key, config.targeting[key]); 45 } 46 } 47 definedSlots[slotId] = slot; 48 googletag.pubads().addEventListener('impressionViewable', function (event) { 49 if (event.slot !== slot) return; 50 setTimeout(function () { 51 googletag.pubads().refresh([slot]); 52 }, SECONDS_TO_WAIT_AFTER_VIEWABILITY * 1000); 53 }); 54 googletag.display(slotId); 55 }); 56 } 57 function initLazyAdsObserver() { 58 if (!('IntersectionObserver' in window)) { 59 Object.keys(AD_SLOTS_CONFIG).forEach(defineAndDisplaySlot); 60 return; 61 } 62 var adObserver = new IntersectionObserver(function (entries, obs) { 63 entries.forEach(function (entry) { 64 if (!entry.isIntersecting) return; 65 var el = entry.target; 66 var rect = el.getBoundingClientRect(); 67 var realDistance = rect.top - window.innerHeight; 68 if (realDistance <= 150) { 69 defineAndDisplaySlot(el.id); 70 obs.unobserve(el); 71 } 72 }); 73 }, { 74 rootMargin: '0px 0px 150px 0px', 75 threshold: 0 76 }); 77 function observeLazyAds(root) { 78 (root || document).querySelectorAll('[data-lazy-ad]').forEach(function (el) { 79 adObserver.observe(el); 80 }); 81 } 82 observeLazyAds(); 83 window.reobserveLazyAds = observeLazyAds; 84 } 85 window.addEventListener('load', function () { 86 setTimeout(initLazyAdsObserver, 500); 87 });
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.