html - Responsive Adsense ad unit won't display at 320x50 px -
i have responsive adsense ad unit serve footer on responsive web site. using media queries, described in adsense documentation, in order set height/width @ different screen widths.
here's css:
<style> @media (min-width: 320px) { .adslot-desktop { width: 320px; height: 50px; display: inline-block; } } @media (min-width: 500px) { .adslot-desktop { width: 468px; height: 60px; display: inline-block; } } </style>
and here's html:
<ins class="adsbygoogle adslot-desktop" data-ad-client="xxxxx" data-ad-slot="xxxxxx" data-ad-format="auto"></ins>
at screen widths on 500px, expected 468x60 ad. however, below 500px, i'm getting 320x100 ad.
why not giving me 320x50 ad appear i'm specifying?
i think you'll need remove data-ad-format
, because data-ad-format
smart sizing:
we calculate required size dynamically based on width of ad unit’s parent container, determine what's best standard height go width.
about responsive ad units:
https://support.google.com/adsense/answer/3213689
what want "exact size per screen width":
<style> .adslot-desktop { width: 320px; height: 50px; } @media (min-width: 500px) { .adslot-desktop { width: 468px; height: 60px; } } </style> <ins class="adsbygoogle adslot-desktop" style="display:inline-block;" data-ad-client="xxxxx" data-ad-slot="xxxxxx"></ins> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <script>(adsbygoogle = window.adsbygoogle || []).push({});</script>
create responsive ad unit > advanced > exact size per screen width: https://support.google.com/adsense/answer/3543893#adv
Comments
Post a Comment