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 - Ads showing only on full page reload and not working on route change #160

Open kovaletsyurii opened 3 years ago

kovaletsyurii commented 3 years ago

A brief description about the bug/error

Ads showing only on page reload. Nothing shows when I changed the route by using nuxt-link.

Config you use

Here is the config that I use:

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

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

Vue.use(Ads.AutoAdsense, { adClient: 'ca-pub-***' })

//nuxt plugins section: 
{ src: '~plugins/ads.js', ssr: false },

Existing vs Expectation

I expect to see ads all the time, including client-side navigation.

kovaletsyurii commented 3 years ago

Looks like issue only with auto ads

mazipan commented 3 years ago

Is it solve by #163 released?

hiepth1988 commented 3 years ago

if you're using nuxt-link orrouter-link, you should change to use <a>: <a :href="item.slug">{{ item.name }}</a> -Nuxt will load ssr page, it will displays the auto ads for you. I have this issue too, but when i change to use <a>element, auto ads always display. thanks you.