Solution To Uncaught TagError In Google Adsense Advertisement


Recently I upgraded my theme version and after updating I faced following issue to one of the adsense ad displayed on my website.

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

Basically there was one ad and there might be some style changes due to which my google adsense ads were not displayed. It was showing error “No slot size for availableWidth=0”.

google logo icon picture

This error occurs when google adsense ad code is trying to insert ad and if it doesn’t find proper width to the parent container where its trying to insert ad.

I am using Mesocolumn theme and it was showing above error. Google adsense ads were not displayed only for Desktop version of the website. For mobile version it was showing proper ads. So I fixed this issue by modifying CSS. I added new CSS code.

Procedure to add new css/edit css is as – Goto Appearance -> Edit CSS and add following code. If you don’t find Edit CSS option then just go and add following code to your stylesheet.

@media only screen and (min-width:800px)and (max-width:3000px) {
    #topbanner {
        width: 640px;
        height: 90px;
    }
}

This is specific to my theme. You need to tweak the width and you can also add media queries for other resolutions, if required.

ProWebGuru: Mostly I write about technology related stuff on https://www.prowebguru.comRecently I have started making videos also. Mostly blog posts & videos are related to technology, programming and learning some new tips and tricks related to windows, wordpress, google app script, technical, programming, javascript, jquery and other coding related stuff.Youtube channel - https://www.youtube.com/user/prowebguru

View Comments (2)

This website uses cookies.