google-adsense: TagError: adsbygoogle.push() error: All ins elements in the DOM with class=adsbygoogle already have ads in them.
Dear Support Team,
I am writing to you because I am experiencing an issue with the @nuxtjs/google-adsense library that I am using on my website. Specifically, I am seeing the following error message in my console:
TagError: adsbygoogle.push() error: All ins elements in the DOM with class=adsbygoogle already have ads in them.
I believe this error is related to the adsbygoogle tags that I am using in my HTML code to display ads on my site. However, I am unsure how to resolve this issue.
i want to load multi tags in one page, and I believe there is a way to make it right.
Could you please provide any additional guidance on how to troubleshoot this issue? I would greatly appreciate any assistance you can provide.
Thank you for your time and attention to this matter.
Best regards,
Yazan Alhaffar
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 12
- Comments: 16 (4 by maintainers)
I think @jbmolle found the issue. If i understand it correctly, if you have no ads on the page, the script still tries to push an ad.
@kylegl I think it’s coming from the querySelector looking only for class adsbygoogle. I’ve done a pull request #192 Adsense adds
<ins class="adsbygoogle adsbygoogle-noablate" style="display: none !important;" data-adsbygoogle-status="done" data-ad-status="unfilled"><div id="aswift_0_host" style="border: medium; height: 0px; width: 0px; margin: 0px; padding: 0px; position: relative; visibility: visible; background-color: transparent; display: inline-block;" tabindex="0" title="Advertisement" aria-label="Advertisement"><iframe ...></iframe></div></ins>which will call adsbygoogle.push() because it has the class adsbygoogle although it’s not an ads placeholderI had
Adsbygoogleaccidentally nested within aClientOnlytag, when i moved it out the error was resolved.