window.googletag = window.googletag || {cmd: []}; var priceRules = {"myinfoapps.com_content_1":{},"myinfoapps.com_m_fixed":{},"myinfoapps.com_top_anchor":{}}; 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['myinfoapps.com_content_1']) { if (priceRules['myinfoapps.com_content_1'][src]) { priceRule = priceRules['myinfoapps.com_content_1'][src]; } } let adSlot; let hasTriedRebid = false; googletag.cmd.push(function() { adSlot = googletag.defineSlot('/22013536576/myinfoapps.com/myinfoapps.com_content_1', [[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/myinfoapps.com/myinfoapps.com_content_1_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['myinfoapps.com_top_anchor']) { if (priceRules['myinfoapps.com_top_anchor'][src]) { priceRule = priceRules['myinfoapps.com_top_anchor'][src]; } } let anchorSlot; let hasTriedRebid = false; googletag.cmd.push(function() { anchorSlot = googletag.defineOutOfPageSlot('/22013536576/myinfoapps.com/myinfoapps.com_top_anchor', 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/myinfoapps.com/myinfoapps.com_top_anchor_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['myinfoapps.com_m_fixed']) { if (priceRules['myinfoapps.com_m_fixed'][src]) { priceRule = priceRules['myinfoapps.com_m_fixed'][src]; } } let mfixedSlot; let hasTriedRebid = false; googletag.cmd.push(function() { mfixedSlot = googletag.defineSlot('/22013536576/myinfoapps.com/myinfoapps.com_m_fixed', [[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/myinfoapps.com/myinfoapps.com_m_fixed_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);