Google Logo

Multiple Google AdSense ad blocks on same page are causing error 400 Bad Response

When trying to include multiple Google AdSense ad blocks using the code provided by Google on the same page you will likely get a 400 Bad Response error.

This is caused by including adsbygoogle.js multiple times:

<script async src="//"></script>

Thus, simply include adsbygoogle.js only once and use the ad generation code where applicable:

<ins class="adsbygoogle"
(adsbygoogle = window.adsbygoogle || []).push({});

Hint: When using WordPress and custom themes you can simply add the required Adsense JS file adsbygoogle.js using the following code in your theme’s functions.php file:

function add_google_adsense_js() {
    wp_enqueue_script( 'google_adsense_js', '//');

add_action( 'wp_enqueue_scripts', 'add_google_adsense_js' ); 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.