google-adsense
google-adsense copied to clipboard
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
I have the same error.
hope we get fix for it
cuz what i see there is no response from them
also same error
This is still very much the case. Has anyone figured out the reason it happens?
We are using this module and don't have this error. Must be a config issue?
Same error.
same error here too.
Same error
I had Adsbygoogle accidentally nested within a ClientOnly tag, when i moved it out the error was resolved.
Same error. Is there any solution?
Do you have an adblocker on by chance?
Do you have an adblocker on by chance?
No, I'm still in dev mode and don't have adblock enabled
can you share a reproduction without your adsense acct creds?
@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 placeholder
can you share a reproduction without your adsense acct creds?
I just install with yarn and add modules in nuxt.config.
yarn add @nuxtjs/google-adsense
export default defineNuxtConfig({
...,
modules: [
...,
'@nuxtjs/google-adsense'
],
googleAdsense: {
id: 'ca-pub-XXXXXXX',
test: true
}
})
When I run yarn dev, it shows this error.
adsbygoogle.js?client=ca-google:221 Uncaught TagError: adsbygoogle.push() error: All 'ins' elements in the DOM with class=adsbygoogle already have ads in them.
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.
The problem is solved
If you just configure it as shown below,
export default defineNuxtConfig({
...,
modules: [
...,
'@nuxtjs/google-adsense'
],
googleAdsense: {
id: 'ca-pub-XXXXXXX',
test: true
}
})
but do not insert the component <Adsbygoogle /> into the page, you will get the above error message.
Same error. How can I fix that?