[] -1) { setTimeout(function () { googletag.pubads().refresh([slot]); }, SECONDS_TO_WAIT_AFTER_VIEWABILITY * 1000); } }); googletag.pubads().enableSingleRequest(); googletag.enableServices(); } googletag.cmd.push(function () { setupGoogleTag(); }); window.constructAds =function() { try { var allAds = document.querySelectorAll(“div[data-adslot]”); if (allAds.length > 0) { allAds.forEach(function (ele) { var adSlot = ele.getAttribute(‘data-adslot’); var adSize = JSON.parse(ele.getAttribute(‘data-size’)); var adType = ele.getAttribute(‘data-ad-type’); var refresh = ele.getAttribute(‘data-ad-refresh’); let r = (Math.random() + 1).toString(36).substring(7); ele.setAttribute(‘id’, r); if (typeof googletag != ‘undefined’) { googletag.cmd.push(function () { var sizeMap = { Responsive_Ad: googletag .sizeMapping() .addSize([992, 0], [[728, 90]]) .addSize([768, 0], [[300, 250]]) .addSize([320, 0], [[300, 250]]) .addSize( [0, 0], [ [320, 50], [1, 1], ] ) .build(), Sticky_Ad: googletag .sizeMapping() .addSize([992, 0], [[728, 90]]) .addSize([768, 0], [[320, 50]]) .addSize([320, 0], [[320, 50]]) .addSize( [0, 0], [ [320, 50], [1, 1], ] ) .build(), Sidebar_Ad: googletag .sizeMapping() .addSize([1500, 0], [[300, 600]]) .addSize([1300, 0], [[160, 600]]) .addSize([992, 0], [[120, 600]]) .addSize([0, 0], []) .build() }; var adSizeMapping = sizeMap[adType]; var slot = googletag.defineSlot(adSlot, adSize, r); if (adSizeMapping) { slot.defineSizeMapping(adSizeMapping); } if (refresh === ‘true’) { slot.setTargeting(REFRESH_KEY, REFRESH_VALUE); } slot.addService(googletag.pubads()); }); } }); } } catch (e) { console.log(“constructAd:” + e); } } window.displayAds = async function() { try { await constructAds(); var allAds = document.querySelectorAll(“div[data-adslot]”); if (allAds.length > 0) { allAds.forEach(function (ele) { var adSlot = ele.getAttribute(‘data-adslot’); var divId = ele.getAttribute(‘id’); if (typeof googletag != ‘undefined’) { googletag.cmd.push(function () { googletag.display(divId); }); ele.removeAttribute(‘data-adslot’); } }); } } catch (e) { console.log(“displayAds:” + e); } } window.addEventListener(‘DOMContentLoaded’, function () { displayAds(); }); })(); var check = false; (function (a) { if (/(android|bbd+|meego).+mobile|avantgo|bada/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)/|plucker|pocket|psp|series(4|6)0|symbian|treo|up.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|)|g1 u|g560|gene|gf-5|g-mo|go(.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp(…
Continue reading