mazipan / vue-google-adsense

💰 Vue.js Google Adsense Component with InFeed and InArticle Ads support
https://mazipan.github.io/vue-google-adsense/
MIT License
257 stars 42 forks source link

[🐛 Bug] - AutoAdsense failed in initialization #156

Closed MarcoGriep88 closed 3 years ago

MarcoGriep88 commented 3 years ago

VueJS Application does not run, when AdSense Component is blocked by adblocker

Existing vs Expectation Just throw an warning when adsense is blocked. Please render an empty component instead of nothing.

Console log Incaught TypeError: Cannot read property 'adClient' of undefined at Object.install (VueGoogleAdsense.esm.min.js:1) at Function.Ci.t.use (vue.runtime.esm.js:5107) at Module.56d7 (main.js:15) at r (bootstrap:79) at Object.0 (app.edd34282.js:1) at r (bootstrap:79) at i (bootstrap:45) at bootstrap:152 at app.edd34282.js:1 adsbygoogle.js:1 Failed to load resource: the server responded with a status of 403 (Forbidden)

mazipan commented 3 years ago

What kind of AdBlocker do you use?

MarcoGriep88 commented 3 years ago

The Webads are blocked by an Webproxy of our company. This issue only appears when i use AutoAds. When i remove them and use the others it works fine.

Best Regards Marco

mazipan commented 3 years ago

Hi @MarcoGriep88

I think it's not related with AdBlock. Maybe your code is wrong. When using AutoAds, it needs an option AdClient

Vue.use(Ads.AutoAdsense, { adClient: 'YOUR_GOOGLE_AD_CLIENT' })
MarcoGriep88 commented 3 years ago

Hi Mazipan,

thanks. you were rights. Its about the adClient. Thanks for your help