Responsive Ad system looked really good on my demo site (with the provided fake images) but for the live site I need to use the actual google code.
Now Google Adsense has the ability to create a responsive unit. But for that you need to add some widths etc.
I tried to figure them out from the css but I am unsure if I did it right because the squared ones does not seem to load on smaller screens.
<style>
.wpi-homepage { width: 200x; height: 200px; }
@media(min-width: 1018x) { .wpi-homepage { width: 250px; height: 250px; } }
@media(min-width: 1200px) { .wpi-homepage { width: 320px; height: 250px; } }
</style>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- WPI Homepage -->
<ins class="adsbygoogle wpi-homepage"
style="display:inline-block"
data-ad-client="ca-pub-"
data-ad-slot=""></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
Any suggestions?
-
This topic was modified 11 years by
Magistar.
Hi,
For google adsense ads you don’t need to set any style attributes as the theme automatically resizes them and the necessary banner it’s loaded. You just need to add your adsesne code as it is in one of the ad boxes from theme panel: http://screencast.com/t/nkjWhRL1zm5
Thanks
Hi there.
My Adsense account offers a “responsive” unit type with smart and manual setting, besides the classic ad units that have a fixed 728×90 / 300×250 / etc.
It is my understanding that you are not allowed to change the format of the regular Add units. But maybe I took this too literally or things have changed since last year since responsive is the new norm.
Maybe someone can tell me if they switched to the (smart)responive ad units or kept using the classic ad units with this theme?
regards
-
This reply was modified 11 years by
Magistar.
Hi,
From what I know the adsense ads aren’t “responsive” as you can notice if your shrink your window size the ads don’t resize but if you reload the pages a right banner size is loaded according to screens width so if you access a page from mobile a mobile version of the banner will be loaded.
You can control this sizes for each screen width from theme panel, under each ad unit you have the option to chose the banner size for each device: http://screencast.com/t/8KVqumQan3
Hope this helps!
Thanks
I use the smart responsive ad units, which is “one code for all” … however, by responsive it means they serve an ad to fill the size of the space container in which the ad is served; it doesn’t mean the ads themselves resize on the fly. This is a new ad unit as of Summer 2014 — an earlier version was noted as “expirimental.” Only issue I’d run into was changing from portrait to landscape on iPad you’d see smaller ad units.
Looks like they updated the ad choices/setup from your screen shot. Nice. The old version was 5+ years old, so nice to see they are updating things finally!
e.g., basic ‘use anywhere’ responsive ad unit
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- 2014-Responsive -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="xxxxxxxxxxx"
data-ad-slot="xxxxxxxxxxxxxxx"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
