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

Advert size error #25

Closed jamiecarter7 closed 5 years ago

jamiecarter7 commented 5 years ago

Im having a weird issue where I am using a set size ad unit (200px x 200px).

I have set the wrapper of this advert at height 400px.

I have used the correct data-ad-slot code where I have set this slot only to give 200x200, yet when loading the site im getting an advert 600px height created.

<ins data-ad-client="REDACTED" data-ad-slot="REDACTED" data-ad-test="" data-ad-format="auto" class="adsbygoogle" style="display: block; height: 600px;" data-adsbygoogle-status="done">


            class="adslot-aside"
            :key="rerenderad"
            data-ad-client="ca-pub-5393590966220416"
            data-ad-slot="REDACTED"
          >
          </Adsense>```

```.adslot-aside {
  max-height: 460px;
}```

Any idea why this is happening?
jamiecarter7 commented 5 years ago

The thing that was throwing me off is the style block inside the ins block

I did some digging and you set the advert type using data-ad-format="auto" [auto, rectangle, vertical, horizontal]

mazipan commented 5 years ago

You can create PR if need improvement in this library @jamiecarter7

vesper8 commented 5 years ago

@jamiecarter7 thanks for your answer.. indeed if you only specify the slot it defaults to the "auto" ad-format and ignores the fixed size you have set on Adsense.. setting 'horizontal' for my leaderboard and 'rectangle' for my rectangles solved the problem.. this should at least be updated in the documentation

mazipan commented 5 years ago

Can you add on the docs @vesper8?

vesper8 commented 5 years ago

@mazipan done: https://github.com/mazipan/vue-google-adsense/pull/60

mazipan commented 5 years ago

Released on 1.8.0