Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TagError: adsbygoogle.push() error: All ins elements in the DOM with class=adsbygoogle already have ads in them. #179

Open
zetaxXx2 opened this issue May 9, 2023 · 21 comments

Comments

@zetaxXx2
Copy link

zetaxXx2 commented May 9, 2023

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

@ivan-mihalic
Copy link

I have the same error.

@yznetaX
Copy link

yznetaX commented May 21, 2023

hope we get fix for it

cuz what i see there is no response from them

@MrTob
Copy link

MrTob commented Sep 7, 2023

also same error

@charbs-io
Copy link

This is still very much the case. Has anyone figured out the reason it happens?

@kylegl
Copy link
Contributor

kylegl commented Sep 22, 2023

We are using this module and don't have this error. Must be a config issue?

@thomasbnt
Copy link

Same error.

@strid3r21
Copy link

same error here too.

@MatthewLeeCode
Copy link

Same error

@merri-ment
Copy link

I had Adsbygoogle accidentally nested within a ClientOnly tag, when i moved it out the error was resolved.

@JasonXDDD
Copy link

Same error. Is there any solution?

@kylegl
Copy link
Contributor

kylegl commented Mar 12, 2024

Do you have an adblocker on by chance?

@JasonXDDD
Copy link

Do you have an adblocker on by chance?

No, I'm still in dev mode and don't have adblock enabled

@kylegl
Copy link
Contributor

kylegl commented Mar 13, 2024

can you share a reproduction without your adsense acct creds?

@jbmolle
Copy link

jbmolle commented Mar 13, 2024

@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

@JasonXDDD
Copy link

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.

@kylegl
Copy link
Contributor

kylegl commented Mar 19, 2024

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.

@leosin
Copy link

leosin commented May 16, 2024

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.

@ernbaltaci
Copy link

ernbaltaci commented Jul 29, 2024

Same error. How can I fix that?

@marcobraghim
Copy link

Same error here

@grcq
Copy link

grcq commented Sep 30, 2024

Got the same problem

@valere-hope
Copy link

same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests