//Script generado para exitonoticias.com.bo (() => { const PREBID_TIMEOUT = 4000; const FAILSAFE_TIMEOUT = 10000; const BID_TIMEOUT = 6000; const REFRESH_TIMEOUT = 30000; const SELLER_ID = "0433"; const GOOGLE_MANAGER_ID = '' ?? 'pub-2768830610135793'; var pbjs = window.pbjs || (window.pbjs = { que: [] }); var googletag = window.googletag || (window.googletag = { cmd: [] }); var winningBids = {}; googletag.cmd.push(function () { googletag.pubads().disableInitialLoad(); }); const BrowserWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; const isMobile = BrowserWidth <= 768; const adUnit0 = "embi_display_video_51dddb2a"; const slot0 = "/22562061343/0433-01_exitonoticias_inline_NC"; const adUnit0Sizes = isMobile ? [ [300, 250], [336, 280], [300, 600], [320, 480] ] : [ [300, 250], [336, 280], [300, 600], [320, 480], [970, 250], [970, 90], [970, 90], [728, 90], [728, 90] ]; const adUnits = isMobile ? [ { code: adUnit0, mediaTypes: { video: { context: "outstream", playerSize: [300, 250], mimes: ["video/mp4"], protocols: [1, 2, 3, 4, 5, 6, 7, 8], playbackmethod: [2], skip: 1, playback_method: ["auto_play_sound_off"], }, banner: { sizes: adUnit0Sizes } }, bids: [ ], ortb2Imp: { ext: { gpid: slot0, data: { pbadslot: slot0 } } } }, ] : [ { code: adUnit0, mediaTypes: { video: { context: "outstream", playerSize: [300, 250], mimes: ["video/mp4"], protocols: [1, 2, 3, 4, 5, 6, 7, 8], playbackmethod: [2], skip: 1, playback_method: ["auto_play_sound_off"], }, banner: { sizes: adUnit0Sizes } }, bids: [ ], ortb2Imp: { ext: { gpid: slot0, data: { pbadslot: slot0 } } } }, ] function loadScript(path, goAsync) { if (!document.querySelector(`script[src='${path}']`)) { const script = document.createElement("script"); script.async = goAsync; script.type = "text/javascript"; script.src = path; document.head.appendChild(script); } } loadScript("https://securepubads.g.doubleclick.net/tag/js/gpt.js", false); loadScript("https://embi-media.com/prebids/production/prebid.js", false); loadScript("https://embi-media.com/hb_resources/teads/teads_cookieless.js"); loadScript("https://a.teads.tv/analytics/tag.js"); loadScript("https://t.seedtag.com/t/7943-0469-01.js"); function styleContainer(container) { container.style.display = "flex"; container.style.gap = "24px"; container.style.background = "transparent"; } (function() { /*const type = "DISPLAY_VIDEO"; const position = "INSERT_AFTER" let element; try { element = document.querySelector(`.tdb-block-inner.td-fix-index`); if (!element && type !== "DISPLAY_VIDEO_STICKY") { console.error(`Elemento con class '$tdb-block-inner.td-fix-index' no encontrado en el DOM`); return; } } catch(e) { element = document.createElement("div"); } finally { console.info(element); } const adsContainer0 = document.createElement("div"); styleContainer(adsContainer0); const adDiv0 = document.createElement("div"); adDiv0.id = adUnit0; adsContainer0.appendChild(adDiv0); defaultAdjacentPosition = "afterend"; adjacentPosition = "afterend"; element.insertAdjacentElement(adjacentPosition, adsContainer0); */ const type = "DISPLAY_VIDEO"; const position = "INSERT_AFTER"; const ubication = "tdb-block-inner.td-fix-index"; const adUnitId = adUnit0; const adUnitSizes = adUnit0Sizes; try { if (type === 'HIGH_IMPACT') { createFullscreenContainer(adUnitId, adUnitSizes); } else if (type === 'DISPLAY_VIDEO_STICKY') { cornerContainer = createCornerContainer(); } else { const targetElement = document.querySelector(`.${ubication}`); if (!targetElement) { console.error(`Elemento con clase '.${ubication}' no encontrado en el DOM para el anuncio ${adUnitId}.`); return; } const adsContainer = document.createElement("div"); styleContainer(adsContainer); const adDiv = document.createElement("div"); adDiv.id = adUnitId; adsContainer.appendChild(adDiv); targetElement.appendChild(adsContainer); } } catch (e) { console.error(`Error procesando el anuncio ${adUnitId}:`, e); } })(); const customConfigObject = { buckets: [ { precision: 2, min: 0, max: 5, increment: 0.01 }, { precision: 2, min: 5, max: 10, increment: 0.1 }, { precision: 2, min: 10, max: 20, increment: 0.5 }, ], }; const consentManagement = { gdpr: { cmpApi: "iab", timeout: 8000, allowAuctionWithoutConsent: false, defaultGdprScope: true, }, gpp: { cmpApi: "iab", timeout: 8e3, defaultGdprScope: true, allowAuctionWithoutConsent: true, }, usp: { cmpApi: "iab", timeout: 100, defaultGdprScope: true, allowAuctionWithoutConsent: true, }, }; pbjs.que.push(function () { pbjs.setConfig({ useBidCache: true, ttlBuffer: 6, timeoutBuffer: 1000, bidderTimeout: PREBID_TIMEOUT, debug: true, priceGranularity: customConfigObject, enableSendAllBids: false, targetingControls: { alwaysIncludeDeals: true }, enableTIDs: true, allowActivities: true, deviceAccess: true, cache: { url: 'https://prebid.adnxs.com/pbc/v1/cache', ignoreBidderCacheKey: true, }, userSync: true, schain: { config: { complete: 1, ver: '1.0', nodes: [ { asi: 'embi-media.com', sid: SELLER_ID, hp: 1 }, { asi: 'google.com', sid: GOOGLE_MANAGER_ID, hp: 1 } ], }, }, }); pbjs.setBidderConfig({ bidders: ["appnexus", "equativ", "teads", "rubicon", "onetag", "richaudience", "adagio"], config: { ortb2: { imp: { ext: { prebid: { floormin: 0.01, }, }, }, }, }, }); pbjs.bidderSettings = { standard: { storageAllowed: true, adserverTargeting: [ { key: "hb_bidder", val: function (bidResponse) { return bidResponse.bidderCode; }, }, { key: "hb_adid", val: function (bidResponse) { return bidResponse.adId; }, }, { key: "hb_pb", val: function (bidResponse) { return bidResponse.pbCg; }, }, { key: "hb_size", val: function (bidResponse) { return bidResponse.size; }, }, { key: "hb_source", val: function (bidResponse) { return bidResponse.source; }, }, { key: "hb_format", val: function (bidResponse) { return bidResponse.mediaType; }, }, ], }, }; pbjs.addAdUnits(adUnits); }); pbjs.que.push(function () { pbjs.requestBids({ timeout: PREBID_TIMEOUT, bidsBackHandler: () => { const bids = pbjs.getBidResponsesForAdUnitCode(adUnit0)?.bids || []; const hasValid = bids.some((b) => b.cpm >= 0.01); if (hasValid) { pbjs.setTargetingForGPTAsync([adUnit0]); googletag.pubads().refresh([adSlot0]); } else { console.warn("🟡 Sin bids válidos. Permitimos que GAM llene solo."); googletag.pubads().refresh([adSlot0]); } }, }); }); let adSlot0; googletag.cmd.push(function () { adSlot0 = googletag .defineSlot(slot0, adUnit0Sizes, adUnit0) .setForceSafeFrame(true) .addService(googletag.pubads()); googletag.pubads().setCentering(true); googletag.enableServices(); googletag.display(adUnit0); }); setInterval(function () { refreshBid(adUnit0, adSlot0); }, REFRESH_TIMEOUT); function refreshBid(adUnitCode, slot) { pbjs.que.push(() => { pbjs.requestBids({ adUnitCodes: [adUnitCode], timeout: PREBID_TIMEOUT, bidsBackHandler: () => { const bids = pbjs.getBidResponsesForAdUnitCode(adUnitCode)?.bids || []; const hasValid = bids.some((b) => b.cpm >= 0.01); if (hasValid) { pbjs.setTargetingForGPTAsync([adUnitCode]); googletag.pubads().refresh([slot]); } else { console.warn(`🟡 Sin bids válidos. GAM llena solo: ${adUnitCode}`); googletag.pubads().refresh([slot]); } }, }); }); } function failsafeRefresh(adUnitCode, slot) { setTimeout(() => { const bids = pbjs.getBidResponsesForAdUnitCode(adUnitCode)?.bids || []; const hasValid = bids.some((b) => b.cpm >= 0.01); if (!pbjs.initAdserverSet && hasValid) { console.warn("⏰ FAILSAFE activado con bid válido"); pbjs.setTargetingForGPTAsync([adUnitCode]); googletag.pubads().refresh([slot]); } else if (!pbjs.initAdserverSet) { console.warn(`⏰ FAILSAFE: sin pujas válidas, dejando que GAM llene (${adUnitCode})`); googletag.pubads().refresh([slot]); } }, FAILSAFE_TIMEOUT); } failsafeRefresh(adUnit0, adSlot0); pbjs.que.push(() => { pbjs.onEvent('bidWon', function(bid) { console.info("bidWon", bid); }); }); googletag.cmd.push(() => { googletag.pubads().addEventListener('slotRenderEnded', function(event) { const id = event.slot.getSlotElementId(); if (!winningBids[id] && !event.isEmpty) { } winningBids[id] = true; console.info('Ad rendered in slot:', event.slot.getSlotElementId(), event); }); }); })()