Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

🐛 Bug - TagError: adsbygoogle.push() error: Only one 'enable_page_level_ads' allowed per page #169

Open
kieron opened this issue Oct 11, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@kieron
Copy link

kieron commented Oct 11, 2021

Hello, I am receiving the following console error:

adsbygoogle.js?clien…7677794196959549:67 Uncaught 
M {message: "adsbygoogle.push() error: Only one 'enable_page_level_ads' allowed per page.", name: 'TagError', pbr: true, stack: "TagError: adsbygoogle.push() error: Only one 'enab…js/adsbygoogle.js?client=7677794196959549:73:107)"}
message: "adsbygoogle.push() error: Only one 'enable_page_level_ads' allowed per page."
name: "TagError"
pbr: true
stack: "TagError: adsbygoogle.push() error: Only one 'enable_page_level_ads' allowed per page.\n    at Tn (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=7677794196959549:223:326)\n    at Sn (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=7677794196959549:222:550)\n    at Zn (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=7677794196959549:229:365)\n    at c (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=7677794196959549:230:38)\n    at $n (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=7677794196959549:230:156)\n    at ko (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=7677794196959549:238:248)\n    at ao (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=7677794196959549:234:451)\n    at https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=7677794196959549:231:47\n    at Qd.n.ma (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=7677794196959549:67:804)\n    at Yd (https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=7677794196959549:73:107)"
[[Prototype]]: Error
constructor: ƒ M(a)
[[Prototype]]: Object

Picture of the error if it's easier:

image

I have my main.js set up like this, and this is the only code I have added, relating to this ad package, so hopefully I am not just missing something silly :)

import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import SvgIcon from "./util/SvgIcon.vue";
import Ads from "vue-google-adsense";
import "@/assets/css/tailwind.css";

Vue.use(require("vue-script2"));
Vue.use(Ads.AutoAdsense, { adClient: "7677794196959549", isNewAdsCode: true });
Vue.config.productionTip = false;

Vue.component("SvgIcon", SvgIcon);

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");

I was hoping to just try these auto-ads out, and let Google do its thing & see what happens, so I enabled Auto ads on the AdSense side of things, but yeah currently getting this.

I can censor my ad ID's but I guess they're public anyway in the source of the site.

Thanks in advance!

@kieron kieron added the bug Something isn't working label Oct 11, 2021
@JessePost1
Copy link

I was getting the same error, and the error went away when I changed 'isNewAdsCode' to be false. Alternatively, you could remove that parameter from the 'use' call entirely, as if defaults to false.

@catalintoma
Copy link

catalintoma commented May 9, 2022

I got the same error and used the solution proposed by @JessePost1
The error is probably because the Auto Ads Components pushes the code after the script loads.
I think the conflict is that probably the new way of loading the library (by sending the published ID) does the same thing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants