- This topic has 12 replies, 2 voices, and was last updated 4 years, 3 months ago by
David.
-
AuthorPosts
-
June 25, 2021 at 3:45 am #1834483
Onur
Hi,
I do not know what happened on my blog today I saw that on the about and contact pages of my blog the google Adsense codes are not working. Also, the WP contact form was not working. Temporarily, I have removed the contact page. I am using the WPForms Lite plugin. This is an another problem, that I will address later.
Now, my question is, on about page: https://www.swtestacademy.com/about/
google adsense codes are not working.
I tried to remove WP_Rocket plugin, disables all optimizations, removed custom css codes, etc. tried everything but I could not solve this problem. Before it is working without any problem. I also did not get it why this problem occurred.
When I open the console I saw the below errors.
Uncaught
Object { message: “adsbygoogle.push() error: No slot size for availableWidth=0”, stack: “N@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:72:574\nYk@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:158:453\nXk@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:157:139\njl@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:164:238\nCm@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:213:503\nTm@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:217:108\nSm@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:216:637\nan@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:230:332\nXm/<@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:225:49\nn.ka@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:67:804\nUe@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:75:106\nXm@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:225:31\nWm@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:222:71\n@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:241:212\nn.ka@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:67:804\nUe@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:75:106\n@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:239:442\n@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:241:315\n@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:243:4\n”, name: “TagError”, pbr: true }
adsbygoogle.js:222:118Uncaught
Object { message: “adsbygoogle.push() error: No slot size for availableWidth=0”, stack: “N@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:72:574\nYk@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:158:453\nXk@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:157:139\njl@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:164:238\nCm@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:213:503\nTm@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:217:108\nSm@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:216:637\nan@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:230:332\nXm/<@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:225:49\nn.ka@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:67:804\nUe@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:75:106\nXm@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:225:31\nWm@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:222:71\n@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:241:212\nn.ka@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:67:804\nUe@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:75:106\n@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:239:442\n@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:241:315\n@https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js:243:4\n”, name: “TagError”, pbr: true }And when I check the generated HTML source code, I did not see the script tags.
Would you please help me to solve this problem please?
June 25, 2021 at 4:22 am #1834510David
StaffCustomer SupportHi there,
looks like the advert cannot calculate the size of its container. Which is probably due to the Content Container being set to Full Width on that page:
https://docs.generatepress.com/article/content-container/
Set it to default – and the advert should then be able to calculate the correct size.
June 25, 2021 at 4:39 am #1834524Onur
Hi David,
Both 3 versions did not work.
Full-width
https://www.swtestacademy.com/about/Default
Contained
June 25, 2021 at 4:43 am #1834526David
StaffCustomer SupportCan you set it and leave it as Default. Then clear any plugin / browser caches. And then let me know so i can take another look.
June 25, 2021 at 3:16 pm #1835249Onur
Hi David,
I have set it as default and clear the caches. Looking forward to hearing from you.
June 25, 2021 at 3:16 pm #1835250June 26, 2021 at 3:27 am #1835549David
StaffCustomer SupportWhat are you using to display different widgets in the sidebars? On the other pages there are other widgets being displayed but none on the About page. Can you add some other widgets to that page
June 26, 2021 at 11:58 am #1835956Onur
Hi David,
I am using this sidebar plugin for custom sidebars: https://wordpress.org/plugins/sidebar-manager/
I am using custom sidebars but the problem not only sidebars. On this page, I am using custom HTML to add the google ads and they are not working as well.
Before, I did not have any problem. I am also investigating what caused this problem. It may be somehow JS-related problem but still, I am not sure and I don’t have any clue.
On posts, blog page, and category pages I don’t have problems.
June 26, 2021 at 3:07 pm #1836034David
StaffCustomer SupportThe advert scripts have
data-ad-format="auto"
attribute – which means it will fit whatever container it sits inside. And that error generally means it cannot calculate the width of that container. I had a google for the issue and there were other users will similar problems but no clear answer to what fixed it.Might be worth change your custom sidebars for that page to one that is working on another page to see if that resolves the issue.
June 26, 2021 at 9:43 pm #1836158Onur
Hi David,
The main problem as I saw was something was removing the <script> tags of the ad code. I did a search on it and I found a plugin shortcoder and rather than using the custom HTML of WordPress, I used the shortcode and this solved the problem.
I think it may be about unfiltered_html attribute but I am not sure. I did not change anything.
June 27, 2021 at 4:54 am #1836317David
StaffCustomer SupportIt’s odd as it doesn’t explain why other pages work correctly and that one doesn’t.
Glad you found a solution to the problem.
June 27, 2021 at 5:01 am #1836320Onur
Yes David, I really did not get why it happened but somehow this trick solved the problem.
Thanks for your support and your time.
Kind Regards,
OnurJune 27, 2021 at 8:01 am #1836614David
StaffCustomer SupportYou’re welcome
-
AuthorPosts
- You must be logged in to reply to this topic.