I am using the following code to insert Google Ads at three slots on my website. However, I am getting the following error:

Uncaught TagError: adsbygoogle.push() error: No slot size for availableWidth=0

<div align="center"> <!-- Sidebar Ads --> <ins class="adsbygoogle"      style="display:block"      data-ad-client="(ad-client-xxxxx)"      data-ad-slot="(xxxxx)"      data-ad-format="auto"      data-full-width-responsive="true"></ins> </div> <script>(adsbygoogle = window.adsbygoogle || []).push({});</script> 

I tried the solution described in the following stack overflow question:

TagError: adsbygoogle.push() error: No slot size for availableWidth=0 when i use responsive ads

However, that didn't seem to help!

Tag:google-ads-api, javascript, elementor

Only one comment.

  1. Haitham BH

    try to set this

    window.onload = function() { (adsbygoogle = window.adsbygoogle || []).push({}); }

    instead of (adsbygoogle = window.adsbygoogle || []).push({}); It work for me

Add a new comment.