Google AdSense Ads for Responsive Website

Responsive web design is a simple & powerful technique that makes website look good across all screen sizes; like- desktop, Laptop, Pad, Mobile phones, Tablets etc.
Google also recommends the responsive design approach for improved indexing since :it keeps your desktop and mobile content on a single URL.”

Responsive Google Ads Code with JavaScript

[code lang=”js”]
<script type="text/javascript">
var width = window.innerWidth || document.documentElement.clientWidth; google_ad_client = "ca-publisher-id"; if (width >= 800) {
google_ad_slot = "Your Ad-unit for 728X60 Ad";
google_ad_width = 728;
google_ad_height = 60;
else if ((width < 800) && (width < 400)) {
google_ad_slot = "Your Ad-unit for 300X250 Ad";
google_ad_width = 300;
google_ad_height = 250;
else {
google_ad_slot = "Your Ad-unit for 468X60 Ad";
google_ad_width = 468;
google_ad_height = 60;
<script type="text/javascript" src="">


Just Replace ca-publisher-id & ad-units.

Leave a Reply


Your Cart

No products in the cart.
Start shopping

About Us

Royal Technologies is a System Integration house that supports Web Design, Web Hosting, Domain Registration, Search Engine Optimizing, IT Consulting, Remote or Telephone Support and Software Development. In simpler terms it’s an IT Company dealing in various aspects of implementation and maintenance of computerization. We have learnt from experience and have molded ourselves to be complete IT Company.



Copyright © 2008-2024 Royal Technologies. All rights reserved.
Development by Royal Technologies