For example, if a web page has three ad slots, will there be a big speed difference between the two methods?

Method 1:

Import adsbygoogle.js only once in the tag:

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-xxxxxxxxxxx" crossorigin="anonymous"></script> 

After that, each ad unit in the page will no longer import the adsbygoogle.js file,only introduce:

<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-xxxxxxxxxxx" data-ad-slot="xxxxxxxxxx" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> 

Method 2:

Each ad unit introduces the adsbygoogle.js file:

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-xxxxxxxxxxx" crossorigin="anonymous"></script> 
<ins class="adsbygoogle"  style="display:block"  data-ad-client="ca-pub-xxxxxxxxxxx"  data-ad-slot="xxxxxxxxxx"  data-ad-format="auto"  data-full-width-responsive=" true"></ins> <script>  (adsbygoogle = window.adsbygoogle || []).push({});  </script> 

I used PageSpeed ​​Insights to analyze the performance of both, and it seems that there is not much difference。

You are welcome to suggest ways to test the performance of the two methods.

Tag:google-ads-api

Add a new comment.