Google Adsense Error “TagError: adsbygoogle.push() error: No slot size for availableWidth=0 ”

后端 未结 13 1411
梦如初夏
梦如初夏 2021-01-31 08:56

I\'m using responsive Google Ads on my website but unfortunately it is not working all the time and most of time it is returning

TagError: adsbygoogle.pus

13条回答
  •  清歌不尽
    2021-01-31 09:26

    I used:

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

    My site was loading pages in a special way, making heavy use of AJAX, so it had to be this way. Hope this helps someone.

    EDIT 2018: I feel like I should mention now that the preferred way to do this would be with window.addEventListener( 'load', ... ), instead of the old method of window.onload = ...

提交回复
热议问题