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

Any chance in supporting Auto Ads? #36

Closed japalekhin closed 5 years ago

japalekhin commented 5 years ago

I liked how Adsense was deciding where/when to place the ads on my site. Now that I've converted to an SPA, I have no choice but to manually put ads.

mazipan commented 5 years ago

I don't get it what do you want. Can you help to explain a bit more?

japalekhin commented 5 years ago

Have you ever heard of "Auto Ads"? So it works by inserting just one snippet of code from Adsense into your site. Nothing else. Then that script looks at your website and automatically puts ads in places it (AI) thinks will give out the best results (or so they say).

That way you don't have to manually place the "In-feed Ad", the "In-article ad", or the "banner ad" on your site. The single script does it for you.

Snakzi commented 5 years ago

Came here to actually ask the exact same question. Will it be supported?

mazipan commented 5 years ago

Can you give me the sample of code for supporting auto ads? Or any link materials?

mazipan commented 5 years ago

In my opinion, if you have no dynamic placement then you can just put in your HTML file. Under head tag. And doesn't need extra library to insert this kind of ads. But, do you have try to use the ordinary AdSense type from this library?

<Adsense
    data-ad-client="ca-pub-XXXXXXXXXXXXXXXX"
    data-ad-slot="1234567890">
</Adsense>

I think this type doesn't require you to put in dynamic placement.

japalekhin commented 5 years ago

That's the thing, it doesn't work. I've tried it. I placed the auto ads code in my page and it doesn't display any ads. I tried resetting the code every time the route is changed by removing it and adding again. No good.

I actually reverted to SSR (WordPress default) architecture to get back my ads.

Also no thanks on manual placement. It's the old way and maybe it will work on some really special really rare occasions. But once you use auto ads, you'll never look back.

mazipan commented 5 years ago

Use the latest version:

import Vue from 'vue'
import Ads from 'vue-google-adsense'

Vue.use(require('vue-script2'))

Vue.use(Ads.AutoAdsense, { adClient: 'YOUR_GOOGLE_AD_CLIENT' })