Reputation: 8530
I'm currently trying out Google Adsense Responsive Ads which work great, but is there a way to show two ads when the screen size passes a specific size?
For example, when the screen size is bigger than 620 pixel, show two "250 x 250" ads next to each other (instead of just one)?
Upvotes: 1
Views: 982
Reputation: 226
You may not put two ads (without some server side coding which may cause various problems) but you can increase or decrease the size of the ad to achieve a similar behavior using media queries. For example: You can show -
For this, you need to use advanced code (code modifications required) in the 'responsive ad' as follows -
<style>
.responsive2 { width: 300px; height: 250px; }
@media(min-width: 500px) { .responsive2 { width: 336px; height: 280px; } }
@media(min-width: 800px) { .responsive2 { width: 728px; height: 90px; } }
@media(min-width: 1200px) { .responsive2 { width: 970px; height: 250px; } }
</style>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Responsive2 -->
<ins class="adsbygoogle responsive2"
style="display:inline-block"
data-ad-client="ca-pub-XXXXX"
data-ad-slot="YYYYY"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
For more details on advanced responsive adsense ad, refer to https://support.google.com/adsense/answer/3543893#adv
Upvotes: 1