scott001 2 Report post Posted August 30, 2018 I use async tags like below to several ads per page. <!-- Advertising Asynchronous JS Tag - Generated with Revive Adserver v4.1.4 --> <ins data-revive-zoneid="325" data-revive-id="1231231236728d3123911a0123"></ins> <script async src="//www.mysite.com/adserv/www/delivery/asyncjs.php"></script> It works fine, however, on site speed tests I am now seeing warning like this: The following scripts are parsed and executed several times on your page: //www.wheat-free.com/adserv/www/delivery/asyncjs.php (parsed and executed 11 times) 1) I am aware of the single page call tag that I've used in the past to serve ads, but is it possible to use the single page call with the async tags? 2) A proposed solution that is used widely, is below, but I am not sure how to make this work for my site..any help would be appreciated. I'm not even sure, once this is written properly for my situation, where the script would go...the header? Here is their example for Facebook--I have bolded area that probably need to to be changed, but again, I am not sure: (function(d, s, id){ var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); So to make this work for my ad script: //www.mysite.com/adserv/www/delivery/asyncjs.php it might look something like this: (function(d, s, id){ var js, mjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "//www.mysite.com/adserv/www/delivery/asyncjs.php"; mjs.parentNode.insertBefore(js, mjs); }(document, 'script', 'mysite-jssdk')); Share this post Link to post Share on other sites
scott001 2 Report post Posted September 6, 2018 Any help would be appreciated....I am surprised that this isn't an issue for more users. Share this post Link to post Share on other sites
Rennew 0 Report post Posted September 14, 2018 In my webiste i call the scirpt in the head section. <script async src="//www.mysite.com/adserv/www/delivery/asyncjs.php"></script> After that i only insert the <ins data-revive-zoneid="325" data-revive-id="1231231236728d3123911a0123"></ins> section for every banner load. Maybe is good four you. Share this post Link to post Share on other sites
andrewatfornax 80 Report post Posted September 18, 2018 Yes, there's no reason why you cannot use both Single Page call and Async JavaScript tags on the same page, if you want to - but that won't give you a single call style Aysnc JS tags, just two different sorts of tags. You can go down the path of trying to combine them all if you want, but I don't think it really matters that the same script is called multiple time - it's okay that it does this, really. Where are you seeing the warnings? Share this post Link to post Share on other sites
scott001 2 Report post Posted September 20, 2018 (edited) Here is what I've done, and I hope my banner stats will still be correct. I removed this tag throughout my entire site in my async ad code. This code appeared with each banner call, and in my case this meant 7 or more times per page load: <script async src="/adserv/www/delivery/asyncjs.php"></script> at the bottom of my site's global template, just before the closing </body> tag, I added this, and notice the "defer" in it: <script async src="/adserv/www/delivery/asyncjs.php" defer></script> I am testing it now, and hope the stats, click tracking, etc. will work. I will report my findings here. Doing this has done several things for my site speed, for example these scripts were causing a render blocking javascript issue on google's page speed tests, which has gone away now. Since the script is only loaded once, it speeds up the loading of each page. Edited September 20, 2018 by scott001 Share this post Link to post Share on other sites
scott001 2 Report post Posted September 22, 2018 This works fine, and perhaps should be the way the code is implemented? Share this post Link to post Share on other sites