With the help of Puppeteer, we have run lighthouse tests on multiple AWS regions with simulated network traffic. 63 test pages have been created based on script location, script injection method, Script Load Type, and Ad Unit Tag Type combination.
Code, Config and test pages are available on branch name year-pagespeed in folder test/pagespeed.
https://bitbucket.org/monetizem/m2hb/src/year-pagespeed/test/pagespeed/
https://docs.google.com/spreadsheets/d/1zVhA4DlWCzWPr5q6sbywhjh61H5uf63RsaBd0gY1ZlE/edit?usp=sharing
Based on average of performance score, time to interactive and speedindex I have found bodyEnd-embeddedWrapped-async performance better for desktop and mobile both.
bodyEnd-embeddedWrapped-async means javascript code to load script asynchronously is wrapped in function and placed at the end of body tag. Please check following snippet with example tag how it looks like.
<body>
<script>
(function(d){
var script = d.createElement(‘script’);
script.async = true;
script.type = ‘text/javascript’;
script.src = ‘//m2d.m2.ai/pghb.minecraftresourcepacks.js’;
var target = d.getElementsByTagName(‘head’)[0];
target.insertBefore(script, target.firstChild);
})(document);
</script>
</body>
Kean Graham is the CEO and founder of MonetizeMore & a pioneer in the Adtech Industry. He is the resident expert in Ad Optimization, covering areas like Adsense Optimization,GAM Management, and third-party ad network partnerships. Kean believes in the supremacy of direct publisher deals and holistic optimization as keys to effective and consistent ad revenue increases.
10X your ad revenue with our award-winning solutions.