Wednesday, April 30, 2014

How : Make google Adsense Responsive For Your Blog

Make google adsense responsive in your responsive design.

responsive-banner

Here is an excerpt from google support:

Google adsense policies do not permit any alteration to AdSense code which artificially inflates ad performance or harms advertiser conversions. Any publisher account offers a number of options when generating the ad code, that google adsense hope will allow you to create an ad layout that fits in with your site. In general, google adsense recommend copying and pasting the ad code. In situations though, google adsense understand modifications are crucial to a clean user experience.

Here the snippet from google support:


  1. <scripttype=“text/javascript”>



  2. google_ad_client =“ca-publisher-id”;



  3. width = document.documentElement.clientWidth;



  4. google_ad_slot =“xxxxxxxxxxxx”;



  5. google_ad_width =320;



  6. google_ad_height =50;



  7. if(width >500)



  8. google_ad_slot =“3456789012″;



  9. google_ad_width =468;



  10. google_ad_height =60;






  11. if(width >800)



  12. google_ad_slot =“xxxxxxxxxxxxxx”;



  13. google_ad_width =728;



  14. google_ad_height =90;






  15. </script>



  16. <scripttype=“text/javascript”src=“http://pagead2.googlesyndication.com/pagead/show_ads.js”>



  17. </script>


What mean that code??

if (width > 500) { is mean If the screen size on your browser more than 500 it will display adsense-sized 468×60

if (width > 800) { is mean If the screen size on your browser more than 800 it will display adsense-sized 728×90

You can try use another size for optimized your website in all device browser size. If your confused with that code you can try use plugin for wordpress.

Here plugin google adsense for responsive design:

http://wordpress.org/plugins/google-adsense-for-responsive-design-gard/

Source: https://support.google.com/adsense/answer/1354736?hl=en


How : Make google Adsense Responsive For Your Blog

No comments:

Post a Comment