window.googletag = window.googletag || {cmd: []}; var priceRules = {}; var urlParams = new URLSearchParams(window.location.search); var src = urlParams.get('src'); function startContent1Script() { try { var priceRule = 4; if (priceRules['trickntips.com_m_content1']) { if (priceRules['trickntips.com_m_content1'][src]) { priceRule = priceRules['trickntips.com_m_content1'][src]; } } let adSlot; let hasTriedRebid = false; googletag.cmd.push(function() { adSlot = googletag.defineSlot('/22013536576/trickntips.com/trickntips.com_m_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/trickntips.com/trickntips.com_m_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['trickntips.com_anchor']) { if (priceRules['trickntips.com_anchor'][src]) { priceRule = priceRules['trickntips.com_anchor'][src]; } } let anchorSlot; let hasTriedRebid = false; googletag.cmd.push(function() { anchorSlot = googletag.defineOutOfPageSlot('/22013536576/trickntips.com/trickntips.com_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/trickntips.com/trickntips.com_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 = 4; if (priceRules['trickntips.com_m_Fixed_954896']) { if (priceRules['trickntips.com_m_Fixed_954896'][src]) { priceRule = priceRules['trickntips.com_m_Fixed_954896'][src]; } } let mfixedSlot; let hasTriedRebid = false; googletag.cmd.push(function() { mfixedSlot = googletag.defineSlot('/22013536576/trickntips.com/trickntips.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/trickntips.com/trickntips.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);