title: How to optimize fetching ads from DFP and google tag manager scripts?
body: <p>I'm part of a team working on improving the lighthouse score of our website :
  <a href="https://www.bikewale.com/m/royalenfield-bikes/classic-350/" rel="nofollow noreferrer">https://www.bikewale.com/m/royalenfield-bikes/classic-350/</a> </p>
  
  <p>We are concentrating on optimising javascript delivery on the page, in order to decrease the time-to-interactive. However, we noticed that scripts like <code>gtm.js</code>, <code>gpt.js</code> and loading of ads on page load, is limiting our maximum improvement to around 70 (lighthouse performance score).</p>
  
  <p>After doing optimisations to javascript delivery on our end, we were able to score atmost 70. We tried removing the js files for google tag manager and gpt, and saw the score rising to 95 (approx). Also, lazy loading all ads, and hence the request to dfp gives us a boost to around 75 (we can't do this due to the first ad is in the first fold).</p>
  
  <p>Please note that we have followed the guides and best practices mentioned in the following links : 
  gtm - <a href="https://developers.google.com/tag-manager/quickstart" rel="nofollow noreferrer">https://developers.google.com/tag-manager/quickstart</a>
  gpt - <a href="https://support.google.com/admanager/answer/7485975" rel="nofollow noreferrer">https://support.google.com/admanager/answer/7485975</a></p>
  
  <p><code>googletag.pubads().refresh(immediateAds); // immediateAds is array of first fold ads</code>
  The refresh method is deteriorating the performance. </p>
  
  <p>Is there a way to optimise the delivery of ads and gtm scripts, in order to improve the performance? Possibly a newer version of the scripts or an alternative? Is there a way to load the first fold ad immediately, and lazy load other ads on the page, without using the <code>refresh()</code> method</p>