/*<![CDATA[*/ var journalismType = "Estandar"; var _cbq = window._cbq = (window._cbq || []); if ($("meta[data-voc-name='journalism_type']").filter("meta[content='agenda propia']").size() > 0) { journalismType = 'Agenda Propia'; } else if ($("meta[data-voc-name='journalism_type']").filter("meta[content='Patrocinada']").size() > 0) { journalismType = 'Nota_Patrocinada'; } if ($("meta[data-voc-name='journalism_type']").filter("meta[content='Mesa de Valor Agregado']").size() > 0) { journalismType = 'Mesa de Valor Agregado'; } let tipoContenido = $("meta[property='tipo-contenido']").attr('content'); const seccionFriendlyname = 'portada'; let tipoPeriodismo = ',Tipo periodismo: ' + journalismType; let tipoContenidoChartbeat = tipoContenido; if (tipoContenido === undefined) { tipoContenido = ''; tipoContenidoChartbeat = '' } else { tipoContenido = ',Tipo Contenido: ' + tipoContenido; } let seccion = 'portada' + tipoContenido + tipoPeriodismo; if (!jQryIter.contextIsArticlePage()) { seccion = seccionFriendlyname; }else{ /* Datos de thumbnail y fecha de actualizacion de la nota*/ const $meta = $('meta'); const _pdate = $meta.filter('[property="date-published"]').attr('content'); const _thumb = $meta.filter('[name="thumbnail"]').attr('content'); if (_pdate & _thumb) { _cbq.push(['_thumb', _thumb], ['_pdate', _pdate]); } } let Autor = $("meta[property='creator']").attr('content'); if (Autor === undefined) { Autor = ''; } console.log('Sección enviada a Chartbeat:', seccion); (function () { /** CONFIGURATION START **/ var _sf_async_config = window._sf_async_config = (window._sf_async_config || {}); _sf_async_config.uid = 21622; _sf_async_config.domain = 'diez.hn'; _sf_async_config.flickerControl = false; _sf_async_config.useCanonical = true; _sf_async_config.useCanonicalDomain = true; _sf_async_config.sections = seccion; _sf_async_config.authors = Autor; /*_sf_async_config.type = tipoContenidoChartbeat; _sf_async_config.sponsorName =journalismType;*/ console.log(_sf_async_config); /** CONFIGURATION END **/ function loadChartbeat() { var e = document.createElement('script'); var n = document.getElementsByTagName('script')[0]; e.type = 'text/javascript'; e.async = true; e.src = '//static.chartbeat.com/js/chartbeat.js'; n.parentNode.insertBefore(e, n); } loadChartbeat(); })(); /*]]>*/ /*<![CDATA[*/ //funciones JS para AD //define los espacios de R89 segun los parametros indicados var isApp = /MagPOC/i.test(window.navigator.Agent); isHonduras = typeof r89 === 'undefined'; gtmDeviceType = isMobileEnvironment ? 'mobile' : 'desktop'; var adType = 'inicio'.trim() || "Section"; if (adType == 'inicio' & isMobileEnvironment) { adType = "home"; } var ads = true; var advertisingClassification = '0'; var journalismType = "Estandar"; var adzone = adzone || {}; if ($("meta[data-voc-name='advertising_classification']").filter("meta[content='no gae']").size() > 0 || 'Portada' == 'Sucesos' || 'Portada' == 'Sexo y pareja') { advertisingClassification = '1'; } if ($("meta[data-voc-name='journalism_type']").filter("meta[content='agenda propia']").size() > 0) { journalismType = 'Agenda Propia'; } else if ($("meta[data-voc-name='journalism_type']").filter("meta[content='Patrocinada']").size() > 0) { journalismType = 'Nota_Patrocinada'; adType = 'Nota_Patrocinada'; } function r89_ad(dimension, position, home = false, video = false) { var className = "r89"; var adContainer = document.createElement("div"); // Evalua si esta en movil var isMobile = typeof isMobileEnvironment !== "undefined" & isMobileEnvironment; if (!video) { className += isMobile ? "-mobile" : "-desktop"; if (dimension == "980x250") { className += "-billboard"; } else if (dimension == "300x250") { className += "-rectangle"; } else if (dimension == "300x600") { className += "-hpa"; } switch (position) { case 1: className += "-atf"; break; case 2: className += "-Mid"; break; case 3: className += jQryIter.contextIsArticlePage() ? "-low" : "-btf"; break; default: className += "-btf"; break; } className += home ? "-home" : ""; className += jQryIter.contextIsArticlePage() ? "-notas INFINITE" : " INCONTENT"; } else { className = "r89-video-Outstream"; } adContainer.className = className; // Insertar el contenedor justo después del script que contiene este código let script = document.currentScript; if (script) { script.insertAdjacentElement("afterend", adContainer); } else { // Alternativa: si `document.currentScript` no está disponible, agregar al final del cuerpo document.body.appendChild(adContainer); } r89Slots.push(className); } //Crea el llamado display segun los parametros indicados function displayAd(dimension = "300x250", brand, adaptative = false) { let current_position; let spaceName; if (dimension) { switch (dimension) { case "980x250": if (adaptative & isMobileEnvironment) { dimension = "300x250"; // Asignar valor de dimension correcto en caso de adaptativo current_position = ++last_banner300x250_displayed; } else { current_position = ++last_banner980x250_displayed; } break; case "300x600": if (adaptative & !isMobileEnvironment) { dimension = '980x250'; current_position = ++last_banner980x250_displayed; } else { current_position = ++last_banner300x600_displayed; } break; case "300x600x250M": if (isMobileEnvironment) { dimension = "300x250"; current_position = ++last_banner300x250_displayed; } else { dimension = "300x600"; current_position = ++last_banner300x600_displayed; } break; case "300x250": //valida si es adaptativo y esta en escritorio if (adaptative & !isMobileEnvironment) { dimension = "980x250"; current_position = ++last_banner980x250_displayed; } else { current_position = ++last_banner300x250_displayed; } break; default: dimension = "300x250"; current_position = ++last_banner300x250_displayed; break; } if (current_position >= 0 & ad_alias[current_position]) { spaceName = `${dimension}_${ad_alias[current_position]}`; // Crear el nuevo div con ID y clase const newDiv = document.createElement("div"); newDiv.id = spaceName; newDiv.className = "ad_block"; // Insertar el nuevo div antes del script actual document.currentScript.parentNode.insertBefore( newDiv, document.currentScript ); // Ejecutar el script de Google Tag Manager googletag.cmd.push(() => { googletag.display(spaceName); }); } } } //define el numero de espacios solicitados segun dimension indicada function defineSlots(dimension_name, dimension_array, brand, max) { if (max >= 0) { for (let index = 0; index < max; index++) { const enviroment = isMobileEnvironment ? "M" : "D"; let id_path = "/3383164/" + brand + "_" + enviroment + "_"; let letter = ad_alias[index] || ""; let path = id_path + adType + "_" + dimension_name + "_" + letter; let alias = dimension_name + "_" + letter; //console.log("Definiendo slot con path:", path, "y alias:", alias); try { let slot = googletag.defineSlot(path, dimension_array, alias).setTargeting("carga", "lazyload").addService(googletag.pubads()); if (slot) { adSlots.push(slot); } else { console.log("Error al definir espacio: " + path); } } catch (err) { console.log( "ocurrio un error al definir el slot: " + alias + " | error: " + err.message ); } } } } //Configura los espacios y tiempo de refresh function setupAdRefresh(adSlots, secondsToWait = 30, refreshKey = "refresh", refreshValue = "true") { // Asigna el targeting de refresh a cada anuncio adSlots.forEach(function (adSlot) { adSlot.setTargeting(refreshKey, refreshValue); }); // Agrega un listener para hacer refresh en cada slot después de la visualización googletag.pubads().addEventListener("impressionViewable", function (event) { var slot = event.slot; if (slot.getTargeting(refreshKey).indexOf(refreshValue) > -1) { setTimeout(function () { googletag.pubads().refresh([slot]); console.log("Refresh on slot " + slot.getSlotElementId()); }, secondsToWait * 1000); } }); } // Define espacios de Ad entre el texto | solucion temporal function defineSlotsTXT(max, brand) { let dimension_array = [300, 250]; let dimension_name = "300x250"; if (max >= 0) { for (let index = 0; index < max; index++) { const enviroment = isMobileEnvironment ? "M" : "D"; let id_path = "/3383164/" + brand + "_" + enviroment + "_"; let letter = ad_alias[index] || ""; let path = id_path + "Notas" + "_" + dimension_name + "_" + letter; let alias = "PUB_TXT_" + letter; //const slot = googletag.defineSlot(path, dimension_array, alias).setTargeting('carga', 'lazyload').addService(googletag.pubads()); //console.log("Definiendo slot con path:", path, "y alias:", alias); try { const slot = googletag .defineSlot(path, dimension_array, alias) ?.setTargeting("carga", "lazyload") .addService(googletag.pubads()); if (slot) { adSlots.push(slot); } else { console.log("Error al definir espacio: " + path); } } catch (err) { console.log( "ocurrio un error al definir el slot: " + alias + " | error: " + err.message ); } } } } if (isHonduras) { // Amazon Publisher Services (APS) permite realizar una subasta en tiempo real para mostrar anuncios !(function (a9, a, p, s, t, A, g) { if (a[a9]) return; function q(c, r) { a[a9]._Q.push([c, r]); } a[a9] = { init: function () { q("i", arguments); }, fetchBids: function () { q("f", arguments); }, setDisplayBids: function () { }, targetingKeys: function () { return []; }, _Q: [], }; A = p.createElement(s); A.async = !0; A.src = t; g = p.getElementsByTagName(s)[0]; g.parentNode.insertBefore(A, g); })( "apstag", window, document, "script", "//c.amazon-adsystem.com/aax2/apstag.js" ); apstag.init({ pubID: "03c4db9e-bacf-4a4a-a134-7a5f911c7cee", adServer: "googletag", simplerGPT: true, }); window.googletag = window.googletag || {}; googletag.cmd = googletag.cmd || []; var brand = 'DZ'; var ad_alias = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P']; var gtmDeviceType = isMobileEnvironment ? 'mobile' : 'desktop'; var adSectionName = 'Portada'.replace(/[?¿ ]/g, ''); var SectionFriendlyName = 'portada'; var baseSection = SectionFriendlyName.split('/'); var adSlots = [], metadatos = [], r89Slots = []; var anchor_Slot = {}; var interstitialSlot = {}; /* slots excluidos de refresh en caso de event.empty */ const refresh_exceptions = [ "DZ_D_inicio_980x250_A", "DZ_D_Section_980x250_A", "DZ_M_home_320x100_A", "DZ_M_Section_320x100_A", "DZ_M_Home_Adhesion_320x50", "DZ_D_Home_Adhesion_728x90", "DZ_M_Section_Adhesion_320x50", "DZ_D_Section_Adhesion_728x90", "DZ_M_Home_Interstitials_320x480", "DZ_D_Home_Interstitials_800x600", "DZ_M_Section_Interstitials_320x480", "DZ_D_Section_Interstitials_800x600", ]; /* Indicadores de banner mostrados segun su dimension/size */ var last_banner980x250_displayed = -1, last_banner300x250_displayed = -1, last_banner300x600_displayed = -1, last_banner320x100_displayed = -1, last_banner160x600_displayed = -1; /**valores maximos de espacion segun seccion y entorno (movil o escritorio) **/ //320x100 var max_320x100_mobile = 1; //300x250 var max_300x250_section_mobile = (parseInt('10') || 0); var max_300x250_section_desk = (parseInt('8') || 0); var max_300x250_detail_mobile = (parseInt('0') || 0); var max_300x250_detail_desk = (parseInt('0') || 0); //300x600 var max_300x600_section_mobile = (parseInt('2') || 0); var max_300x600_section_desk = (parseInt('1') || 0); var max_300x600_detail_mobile = (parseInt('0') || 0); var max_300x600_detail_desk = (parseInt('0') || 0); //980x250 var max_980x250_section_desk = (parseInt('5') || 0); var max_980x250_detail_desk = (parseInt('0') || 0); var max_text_300x250 = 0; //condiciones para limites de espacios en fotogaleria if (jQryIter.contextIsArticlePage()) { // Determina el meta tag según el tipo de anuncio let metaTagName = 'fotogaleria'; let metaTag = document.querySelector(`meta[name="${metaTagName}"]`); // Verifica si el meta tag existe y obtiene el valor de "content" if (metaTag == null) { metaTagName = 'paragraphCount'; metaTag = document.querySelector(`meta[name="${metaTagName}"]`); } if (metaTag != null) { // Obtiene el valor de "content" try { contentValue = parseInt(metaTag.getAttribute('content'), 10); } catch (err) { console.log("Error al obtener valor del metadato"); } if (!isNaN(contentValue)) { // Asigna el valor máximo de espacios 300x250 if (metaTagName == "paragraphCount") { let aditional_spaces = Math.floor(contentValue / 3); max_300x250_detail_desk += aditional_spaces; max_300x250_detail_mobile += aditional_spaces; max_300x250_detail_desk = Math.min(max_300x250_detail_desk, ad_alias.length - 1); max_300x250_detail_mobile = Math.min(max_300x250_detail_mobile, ad_alias.length - 1); } else { max_300x250_detail_mobile += Math.floor(contentValue); max_300x250_detail_mobile = Math.min(max_300x250_detail_mobile, ad_alias.length); } } } $("meta[data-voc-name=topic]").each(function () { metadatos.push($(this).attr('content')); }); } googletag.cmd.push(function () { /*MOVIL*/ if (isMobileEnvironment) { //---Movil--- Detalle de nota ---// if (jQryIter.contextIsArticlePage()) { max_banner_300x600 = max_300x600_detail_mobile; max_banner_300x250 = max_300x250_detail_mobile; } else { max_banner_300x600 = max_300x600_section_mobile; max_banner_300x250 = max_300x250_section_mobile; } //--- Espacios 320x100 ---// defineSlots('320x100', [320, 100], brand, max_320x100_mobile); if (adType == 'inicio' || adType == 'home') { if (!isApp) { anchor_Slot = googletag.defineOutOfPageSlot("/3383164/DZ_M_Home_Adhesion_320x50", googletag.enums.OutOfPageFormat.BOTTOM_ANCHOR,); interstitialSlot = googletag.defineOutOfPageSlot("/3383164/DZ_M_Home_Interstitials_320x480", googletag.enums.OutOfPageFormat.INTERSTITIAL,); } googletag.defineSlot('/3383164/DZ_M_QUIEROCASAS_320X40', [320, 40], 'DZ_M_QUIEROCASAS_320X40').setTargeting('carga', 'lazyload').addService(googletag.pubads()); } else { //-- RichMedia --// if (!isApp) { anchor_Slot = googletag.defineOutOfPageSlot("/3383164/DZ_M_Section_Adhesion_320x50", googletag.enums.OutOfPageFormat.BOTTOM_ANCHOR,); interstitialSlot = googletag.defineOutOfPageSlot("/3383164/DZ_M_Section_Interstitials_320x480", googletag.enums.OutOfPageFormat.INTERSTITIAL,); } } /*DESK*/ } else { //--- Solo para Detalle de nota desk ---// if (jQryIter.contextIsArticlePage() == true) { max_banner_300x600 = max_300x600_detail_desk; max_banner_300x250 = max_300x250_detail_desk; max_banner_980x250 = max_980x250_detail_desk; } else { max_banner_300x600 = max_300x600_section_desk; max_banner_300x250 = max_300x250_section_desk; max_banner_980x250 = max_980x250_section_desk; } /*********Comunes entre detalle y seccion*****/ defineSlots('980x250', [[980, 250], [728, 90]], brand, max_banner_980x250); //-- RichMedia y espacios especiales --// if (adType == 'inicio' || adType == 'home') { if (!isApp) { interstitialSlot = googletag.defineOutOfPageSlot("/3383164/DZ_D_Home_Interstitials_800x600", googletag.enums.OutOfPageFormat.INTERSTITIAL,); anchor_Slot = googletag.defineOutOfPageSlot("/3383164/DZ_D_Home_Adhesion_728x90", googletag.enums.OutOfPageFormat.BOTTOM_ANCHOR,); } adSlots.push(googletag.defineSlot('/3383164/dz_d_inicio_160x600_la', [160, 600], '160x600_LA').addService(googletag.pubads())); adSlots.push(googletag.defineSlot('/3383164/dz_d_inicio_160x600_lb', [160, 600], '160x600_LB').addService(googletag.pubads())); googletag.defineSlot('/3383164/DZ_D_QUIEROCASAS_950X50', [950, 50], 'DZ_D_QUIEROCASAS_950X50').setTargeting('carga', 'lazyload').addService(googletag.pubads()); } else { adSlots.push(googletag.defineSlot('/3383164/dz_d_Section_160x600_la', [160, 600], '160x600_LA').addService(googletag.pubads())); adSlots.push(googletag.defineSlot('/3383164/dz_d_Section_160x600_lb', [160, 600], '160x600_LB').addService(googletag.pubads())); if (!isApp) { interstitialSlot = googletag.defineOutOfPageSlot("/3383164/DZ_D_Section_Interstitials_800x600", googletag.enums.OutOfPageFormat.INTERSTITIAL,); anchor_Slot = googletag.defineOutOfPageSlot("/3383164/DZ_D_Home_Adhesion_728x90", googletag.enums.OutOfPageFormat.BOTTOM_ANCHOR,); } } } /*********Comunes entre detalle y seccion sin importar si es seccion, detalle , movil o desktop*****/ //--- Espacios 300x250 ---// defineSlots('300x250', [300, 250], brand, max_banner_300x250); //--- Espacios 300x250 ---// defineSlots('300x600', [[300, 600], [160, 600]], brand, max_banner_300x600); //Activa la carga en modo lazyload para los slots con .setTargeting('carga', 'lazyload') googletag.pubads().enableLazyLoad({ fetchMarginPercent: 350, renderMarginPercent: 150, mobileScaling: 1.5 }); // Numero de segundos a esperar para hacer refresh var SECONDS_TO_WAIT_AFTER_VIEWABILITY = 30; var REFRESH_KEY = 'refresh'; var REFRESH_VALUE = 'true'; if (anchor_Slot) { anchor_Slot.setTargeting("test", "anchor").addService(googletag.pubads()); adSlots.push(anchor_Slot); //console.log("Anchor_top ad is initialized"); } if (interstitialSlot) { interstitialSlot.addService(googletag.pubads()).setConfig({ interstitial: { triggers: { navBar: true, unhideWindow: true, }, }, }); //console.log("Intertitial ad is initialized"); } else { console.warn("El slot interstitial no es compatible con este dispositivo o página."); } setupAdRefresh(adSlots, SECONDS_TO_WAIT_AFTER_VIEWABILITY, REFRESH_KEY, REFRESH_VALUE); googletag.pubads().disableInitialLoad(); googletag.pubads().enableSingleRequest(); googletag.pubads().setTargeting(REFRESH_KEY, REFRESH_VALUE); googletag.pubads().setTargeting('Section_DZ', adSectionName); googletag.pubads().setTargeting('Clasificacion', advertisingClassification); googletag.pubads().setTargeting('palabras_clave', metadatos); // Enable all services apstag.fetchBids({ timeout: 2000 }, function (bids) { apstag.setDisplayBids(); googletag.pubads().refresh(); }); var retryAttempts = {}; // Contador por slot googletag.pubads().addEventListener('slotRenderEnded', function (event) { var slot = event.slot; var slotId = slot.getSlotElementId(); let adUnitPath = slot.getAdUnitPath(); let slotName = adUnitPath.split('/').pop(); // Extrae solo el nombre del slot if (!retryAttempts[slotId]) { retryAttempts[slotId] = 0; } if (event.isEmpty & retryAttempts[slotId] < 3 && !refresh_exceptions.includes(slotName)) { // Máximo 3 intentos retryAttempts[slotId]++; //console.log(`Intento ${retryAttempts[slotId]} para el slot "${slotId}" | slotName`); setTimeout(function () { googletag.pubads().refresh([slot]); }, 2000); } else if (event.isEmpty) { console.log(`El slot "${slotId}" alcanzó el máximo de intentos permitidos.`); } }); googletag.enableServices(); }); } /*]]>*/ 591m2i

`; } else { card.className = "bloque-secundario"; card.innerHTML = `
${article.position}

${article.section_name} 2l5x64

`; } container.appendChild(card); } }); } // document.body.appendChild(container); // Append the container to the body or a specific element } catch (error) { console.error("Error fetching or rendering articles:", error); } } console.log("defineSlot ad finished testing lomasleido-v1"); /*]]>*//*]]>*/

Diario Deportivo Diez 1k402g