Closed 158008001 closed 5 years ago
PRs are welcome
yes I'm seeing this as well.. trying to get a mobile leaderboard seems to be impossible.. it always displays a medium rectangle instead
this is what I'm using:
<Adsense
v-if="ad.valid"
data-ad-client="ca-pub-xxxxxxxxxxxxxxxxxx"
data-ad-slot="1234567890"
ins-class="w320h50"
data-ad-format="rectangle"
:data-full-width-responsive="true"
/>
.w320xh50 {
display:inline-block;
width:320px !important;
height:50px !important;
}
You would think this would force a 320x50 banner to show.. but because of (recent?) changes to how Adsense generates the ad, it ends up looking like this:
<ins data-ad-client="ca-pub-xxxxxxxxxxxxxxxxxxx" data-ad-slot="1234567890" data-ad-test="" data-ad-format="horizontal" data-full-width-responsive="true" class="adsbygoogle w320xh50" style="display: block; margin-left: -24px; width: 360px; z-index: 30; height: auto !important;" data-adsbygoogle-status="done">...</ins>
And so the height: auto !important;
takes precedence over the height:50px !important;
inside my class
This slot isn't even a responsive banner by the way, it's a fixed size 320x50 but it seems that what you set on Adsense's side is completely ignored... the code that Adsense generates does include a style
directive.. which your plugin does not currently allow us to set
<!-- leaderboard-mobile -->
<ins class="adsbygoogle"
style="display:inline-block;width:320px;height:50px"
data-ad-client="ca-pub-xxxxxxxxxxxxxxxxxxx"
data-ad-slot="1234567890"></ins>
<script>
So I think that is the problem and the way to fix it is to add a ins-style
attribute to mimic how Adsense generates the code
@mazipan added PR https://github.com/mazipan/vue-google-adsense/pull/57, followed you and starred your project : )
please merge if all looks good.. thank you!
and publish new release : )
Will releasing new version on 21 Oct 2019
, I am on holiday.
@all-contributors please add @vesper8 for code
@mazipan
I've put up a pull request to add @vesper8! :tada:
Released on 1.8.0
Adding a class limit height to an automated ad is no longer valid, and adsense will force an adaptive height. Can I add an attribute to control style? Such as ins-style