window.googletag = window.googletag || {cmd: []}; var priceRules = {}; var urlParams = new URLSearchParams(window.location.search); var src = urlParams.get('src'); function listenAdClicks() { let isAdsArea = false; let ad_link = ''; function detectAdsArea(e) { const iframe = e.target.closest('iframe'); if (iframe) { isAdsArea = true; ad_link = iframe.getAttribute('src'); } else { isAdsArea = false; ad_link = ''; } } document.addEventListener('mouseover', detectAdsArea); document.addEventListener('touchmove', detectAdsArea, { passive: true }); window.addEventListener('blur', function () { if(isAdsArea) { fbq('track', 'ViewContent'); } }); } googletag.cmd.push(function() { googletag.pubads().addEventListener('slotVisibilityChanged', function(event) { const visibility = event.inViewPercentage; if (visibility > 0) { listenAdClicks(); } }); }); googletag.cmd.push(function() { googletag.pubads().addEventListener('slotVisibilityChanged', function(event) { const slotPath = event.slot.getAdUnitPath(); const visibility = event.inViewPercentage; if (slotPath.includes('interstitial') && visibility >= 1) { fbq('track', 'ViewContent'); } }); }); function startContent1Script() { try { var priceRule = 6; if (priceRules['infostec.com_content1']) { if (priceRules['infostec.com_content1'][src]) { priceRule = priceRules['infostec.com_content1'][src]; } } let adSlot; let hasTriedRebid = false; googletag.cmd.push(function() { adSlot = googletag.defineSlot('/22013536576/infostec.com/infostec.com_content1', [[336, 280], [300, 250], [250, 250], 'fluid'], 'div-gpt-ad-1715818371803-0'); adSlot.setTargeting("floor_price", [`r_${priceRule}`]); adSlot.addService(googletag.pubads()); googletag.pubads().addEventListener('slotRenderEnded', function(event) { if (event.slot.getSlotElementId() === 'div-gpt-ad-1715818371803-0') { if (event.isEmpty && !hasTriedRebid) { hasTriedRebid = true; googletag.destroySlots([adSlot]); setTimeout(() => { adSlot = googletag.defineSlot('/22013536576/infostec.com/infostec.com_content1_rebid', [[336, 280], [300, 250], [250, 250], 'fluid'], 'div-gpt-ad-1715818371803-0').addService(googletag.pubads()); googletag.display('div-gpt-ad-1715818371803-0'); googletag.pubads().refresh([adSlot]); }, 150); } } }); googletag.enableServices(); googletag.display('div-gpt-ad-1715818371803-0'); }); } catch (error) { console.error('Error in startContent1Script:', error); } } startContent1Script(); function startTopAnchorScript() { try { var priceRule = 4; if (priceRules['infostec.com_top_anchor_264323']) { if (priceRules['infostec.com_top_anchor_264323'][src]) { priceRule = priceRules['infostec.com_top_anchor_264323'][src]; } } let anchorSlot; let hasTriedRebid = false; googletag.cmd.push(function() { anchorSlot = googletag.defineOutOfPageSlot('/22013536576/infostec.com/infostec.com_top_anchor_264323', googletag.enums.OutOfPageFormat.TOP_ANCHOR); anchorSlot.setTargeting("floor_price", [`r_${priceRule}`]); anchorSlot.addService(googletag.pubads()); googletag.pubads().addEventListener('slotRenderEnded', function(event) { if (event.slot.getSlotElementId() === anchorSlot.getSlotElementId()) { if (event.isEmpty && !hasTriedRebid) { hasTriedRebid = true; googletag.destroySlots([anchorSlot]); setTimeout(() => { anchorSlot = googletag.defineOutOfPageSlot('/22013536576/infostec.com/infostec.com_top_anchor_264323_rebid', googletag.enums.OutOfPageFormat.TOP_ANCHOR).addService(googletag.pubads()); googletag.display(anchorSlot.getSlotElementId()); googletag.pubads().refresh([anchorSlot]); }, 150); } } }); googletag.enableServices(); googletag.display(anchorSlot.getSlotElementId()); }); } catch (error) { console.error('Error in startTopAnchorScript:', error); } } startTopAnchorScript(); function startMFixedScript() { try { var priceRule = 2; if (priceRules['infostec.com_m_fixed_954896']) { if (priceRules['infostec.com_m_fixed_954896'][src]) { priceRule = priceRules['infostec.com_m_fixed_954896'][src]; } } let mfixedSlot; let hasTriedRebid = false; googletag.cmd.push(function() { mfixedSlot = googletag.defineSlot('/22013536576/infostec.com/infostec.com_m_fixed_954896', [[300, 50], [320, 50]], 'div-gpt-ad-1686178920381-0'); mfixedSlot.setTargeting("floor_price", [`r_${priceRule}`]); mfixedSlot.addService(googletag.pubads()); googletag.pubads().addEventListener('slotRenderEnded', function(event) { if (event.slot.getSlotElementId() === mfixedSlot.getSlotElementId()) { if (event.isEmpty && !hasTriedRebid) { hasTriedRebid = true; googletag.destroySlots([mfixedSlot]); setTimeout(() => { mfixedSlot = googletag.defineSlot('/22013536576/infostec.com/infostec.com_m_fixed_954896_rebid', [[300, 50], [320, 50]], 'div-gpt-ad-1686178920381-0').addService(googletag.pubads()); googletag.display(mfixedSlot.getSlotElementId()); googletag.pubads().refresh([mfixedSlot]); }, 150); } } }); googletag.enableServices(); googletag.display(mfixedSlot.getSlotElementId()); }); } catch (error) { console.error('Error in startMFixedScript:', error); } } setTimeout(startMFixedScript, 150);