Author: Ivee

Google AdSense Ads Can Adjust For Responsive Websites

Your responsive website has been designed for precisely one reason: to provide the best viewing experience through easy navigation and reading on a variety of devices such as desktop computers, tablets, TV, and mobile phones. The design tries to minimize scrolling, panning, and resizing. Responsive websites look good and right on any screen size.

<b>Google AdSense and Your Website</b>

On the other hand, Google ads served by Google AdSense are not responsive like your responsive website. Google AdSense automatically serves advertisements in various media types that include image and video on content sites that include mostly responsive websites. Most of these ads come in fixed sizes that will not automatically adjust by default to the screen size of the device.

<b>Adjusting Ad Sizes</b>

However, there is a way to tweak the process via a simple JavaScript code that enables the Google ad to adapt to screen size. Below is the JavaScript code that you can use:

// = 800) {

google_ad_slot = “ad-unit-1″;

google_ad_width = 728;

google_ad_height = 60;

} else if (window.innerWidth

// ]]>

<b>Things to Remember</b>

You first have to generate ad versions such as 768×90, 468×60, and 300×250. You can create other sizes bearing other values. Simply change the google_ad_client and google_ad_slot values with your own. It would be helpful to learn more about your AdSense JavaScript code. This results in having the appropriate format to fit the browser width of the user’s device.

The window.innerWidth property is what supports the internal format adaptation. This holds the width of the browser window measured in pixels. With information on the value, AdSense advertisements can be made to respond according to screen sizes.

<b>Optimizing Your Viewers’ Experience</b>

Google AdSense is a great way to monetize ads on sites. Google highly advises sites to have responsive web design for better indexing because both desktop and mobile content can be contained on a single URL. With today’s devices coming in various sizes, making the Google AdSense ads appropriately responsive to each and every device screen size via a JavaScript code only helps the viewing experience and the ultimate purpose of advertisements.

With the code, the specific advertisement unit will automatically format into any browser width. This is not going against AdSense terms of use because the ads are not necessarily and organically resized or modified. They are simply reformatted according to the width of the user’s browser size while keeping the integrity of the ad.

Post Navigation