Are you planning on changing or messing with your site's or blogs design to get them ready for displaying responsive adsense ads? Well then here's a good news, you need not change your site's design to display google adsense responsive ads. Even without using or creating responsive adsense ads you can still show responsive adsense ads on your site and thereby doubling or tripling your adsense targeting for more revenues. Here is how you can display responsive adsense ads on your site or blog through the following mentioned steps below.
- First a fall login to your adsense dashboard and create a new ad unit of width 300 or less and choose their type ( image, text or text+image ) , best choice would be text+image as it increases targeting on ad placements. Now just save the ad unit and copy the code to notepad as we will need it in next step.
2. Now in the pasted code look for
google_ad_client = "ca-pub-XXX";
google_ad_slot = "YYY"; and note down the values XXX and YYY. Now substitute these values in the below given code.
google_ad_client = "ca-pub-XXX";
google_ad_slot = "YYY"; and note down the values XXX and YYY. Now substitute these values in the below given code.
<div id="google-ads-1"></div> <script type="text/javascript"> /* Replace ca-pub-XXX with your AdSense Publisher ID */ google_ad_client = "ca-pub-XXX"; /* Replace YYY with the AdSense Ad Slot ID */ google_ad_slot = "YYY"; /* Replace ZZZ with the custom height of your Ad Unit */ google_ad_height = "ZZZ"; ad = document.getElementById('google-ads-1'); if (ad.getBoundingClientRect().width) { google_ad_width = ad.getBoundingClientRect().width; } else { google_ad_width = ad.offsetWidth; // for old IE } if (google_ad_width>1200) { google_ad_width = 1200; } else if (google_ad_width<120) { google_ad_width = 120; } if (google_ad_height>1200) { google_ad_height = 1200; } else if (google_ad_height<50) { google_ad_height = 50; } if ((google_ad_width>300) && (google_ad_height>300)) { google_ad_height = 300; } document.write ( '' ); (adsbygoogle = window.adsbygoogle || []).push({}); </script> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"> </script> <!--tutorial at geniusknight.weebly.com -->
Remember ZZZ can't exceed 600 as responsiveness is designed for both square format and skyscraper ads which don't exceed 600 so using, 600, 300, 250, 200 or anything below is suggested. Finally after substituting your adclient values simply put the code in your website or blog and see the magic as now you can see extended/ responsive ads on your site which will deliver higher engagement and targeting and revenues as now your old adsense code is replaced by a much smarter code. In short your ad can now expand or shorten on various platforms and that too without making your site responsive. Script by labnol.org That's all folks for today. For further updates subscribe or leave a comment below for any queries.