Site logo

Archived topic

Header ad not displayed

5 replies · Started by Keshav on December 28, 2019

Viewing posts 1–6 of 6

Hi,

I have added google ad at header through widget. But ad is not showing on website.

Website URL is: wikiwiki.in

Please help.

Thanks

Hi there,

i am seeing this error in the developers console:

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

This happens when a Respsonsive Ad is loaded into a container that has no set width.

You can test to see if this is the issue by adding this CSS:

.header-widget .custom-html-widget .adsbygoogle {
    min-width: 640px;
}

Thanks for replying.

Code is working on desktop but not working on mobile.

Thats because you have the Mobile Header enabled in Customizer > Layout > Header.
This removes the Header Widget. You would need to disable this for it to work.

You would also need to adjust CSS for mobile and desktop:

/* Mobile */
@media(min-width: 768px) {
    .header-widget .custom-html-widget .adsbygoogle {
        width: auto;
        max-width: 640px;
    }
}

/* Desktop */
@media(min-width: 769px) {
    .header-widget .custom-html-widget .adsbygoogle {
        min-width: 640px;
    }
}

Adjust the Width properties accordingly.

Thank you so much.. Issue resolved.

You're welcome

This archived topic is closed to new replies.