Forum Moderators: martinibuster
New Choice for Ad Type
[edited by: martinibuster at 10:59 pm (utc) on Jul 1, 2013]
[edit reason] Fixed URL. [/edit]
Anyone know if this can be applied to existing ad codes via editing in the control panels?
I'd think if you use the same channels, you're probably ok
Edit: You can remove the inline dimensions and define the ad size via external css. Perfect for responsive design.
For example, if I have a 160x600 ad on my desktop version, does Google render a 320x50 mobile ad if that is the CSS height/width I provide for the responsive Smartphone version?
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<script type="text/javascript">
google_ad_client = "ca-pub-xxxxxxxxxxx";
if ($(window).width() >= 730) {
google_ad_slot = "xxxxxxxxx";
google_ad_width = 728;
google_ad_height = 90;
} else {
google_ad_slot = "xxxxxxxxx";
google_ad_width = 320;
google_ad_height = 50;
}
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script> The ad block size is based on the width and height of the <ins>, which can be set inline, as shown here, or via CSS.
So I took out the code and restored the old. No ads show up!
Not sure whether you can use external css. Although I suspect this is the long term plan. Looking at the Adsense JS code, it interrogates the element.style.width and element.style.height, and then constructs the ad call from that.
<script async src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> in the head section -- works great as I said.
has anyone confirmed the ads show on Android devices?
There is no noticeable difference in performance.