--> How To Create Responsive Ad Units in AdSense? | Experience Lab - Online business creation and development guide for bloggers and startups

How To Create Responsive Ad Units in AdSense?

If you have spent any time surfing the internet on your mobile device, looking for information or reading a blog post, you will know how imp...


Create Responsive AdSense Ad Units


If you have spent any time surfing the internet on your mobile device, looking for information or reading a blog post, you will know how important and satisfying a mobile-optimized website is to a reader. The trend of using mobile devices to connect to the internet has sharply risen, which means webmasters should have websites that cater to the needs of varying screen sizes and varying resolutions. Having a responsive design not only means having a responsive website theme layout, but also having responsive elements, down to the small images and ad units. Speaking of which, Google AdSense has now announced support for responsive ad units, which means that now, you can even change the size of those ad units dynamically depending on the user agent!

Recommended for you: How To Serve Responsive Images On Your Site




One of the biggest challenges publishers currently face is designing websites that adapt to different screen sizes, resolutions and user experiences. People have been asking for responsive ad units to help them deliver the best possible user experience on their pages. So the Google AdSense has finally listened to the feedback, and has now made responsive ad units available as a beta feature.





The responsive ad-units use the new asynchronous ad code. This code can be used to set the size of the ad code directly via Cascading Style Sheets (CSS), which allows webmasters to dynamically specify the size of the ad that will be served. Ad sizes previously were fixed, and weren't supposed to be tampered with.


How to create responsive ad units in AdSense?


Step 1: Generating ad code




To create a responsive ad-unit, you first have to log into Google AdSense, and create an ad unit, just like you would create an ordinary (non-responsive) ad-unit. 





The only difference is, when creating an ad unit, you need to change one option. While creating an ad unit, you will see a drop-down labelled Ad Size. Select the Responsive Ad Unit (BETA) option. Only difference from this and the normal process is, you won't see the Code Type option selector, because Responsive ads already use asynchronous code.



Step 2: Place the ad unit




Now that have the code, this is the easy bit. Simply insert that code into your website source HTML, or in a widget or post/page. You can put this code anywhere you can put the normal non-responsive code.



Step 3: Adjusting the size



Now, you can change the size of the ad-units based on the user agent. This will make use of media queries in CSS to determine the screen size/resolution of the client.



For example, a normal non-responsive ad unit's CSS might look something like this;




.adslot_1 {

width: 320px;

height: 50px;

}



Whereas the CSS for the responsive ad unit would look like this;




.adslot_1 {

width: 320px;

height: 50px;

}

@media (min-width:500px) {

.adslot_1 {

width: 468px;

height: 60px;

}

}

@media (min-width:800px) {

.adslot_1 {

width: 728px;

height: 90px;

}

}



Note how @media queries are used to detect the screen-size/resolution of the client.


Things to remember





  • While changing the size of the ad-units using CSS, make sure the dimensions you enter match Google AdSense's supported ad sizes

  • Media queries might not work for older browsers, so always set a default size

  • These new ad units are responsive on the initial load only. Subsequent changes to screen orientation and screen resolution will not effect these ad units. But Google is working to improve on this, and make it fully responsive





Have you tried out the responsive ad units yet? What are you waiting for? Try them out now, and tell us what you think about them. And leave your responses/opinions in the comments section below. Cheers :)

COMMENTS

Name

Affiliate Marketing,12,Announcement,34,Bing,9,Bitcoin,38,blog,7,Blogger Resources,42,Blogger Templates,4,blogger tricks,156,Blogging ethics,70,Blogging tips,198,Bugs and Errors,34,Business,9,Copyright Violation,9,CSS and HTMLTricks,95,Designs,8,drop down menu,7,eBook,12,Email Marketing,7,Events,30,Facebook,30,Facebook tricks,49,Google,157,Google AdSense,42,Google Analytics,7,Google Plus,51,Google Plus Tricks,38,Guest Posts,112,home,2,How To,77,Internet,1,JSON Feeds,25,Kitchen Recipes,2,Label Based Sitemap Themes,1,Make Money Online,108,Marketing,16,MBT Blogger Templates,7,Menus,1,News,146,Pages,1,Posts,10,presentations,15,Responsive,10,Reviews,7,SEO,307,Settings,6,Shortcode,15,Sitemap Themes,1,Social Media,155,Technology,7,Templates,1,Tips,2,Tools,1,Traffic Tips,80,Video,19,Web Designing,62,web hosting,18,Webmaster Tools,97,Widgets,199,wordpress,26,
ltr
item
Experience Lab - Online business creation and development guide for bloggers and startups: How To Create Responsive Ad Units in AdSense?
How To Create Responsive Ad Units in AdSense?
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibm8oZ8483okNnRwBqs4vlViPy2bxJagFBcDlIYVdg98TmgWai_Fs_Ai9mp500badjptJPFQm5fSRoL4PcEK3v1jGhawcz12c_VFZRa1X8-yCgA3Cqj1vvZBj1VuYWEpQpN3kzM_Jb9RLU/s320/responsive-adsense-ad-units.jpg
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibm8oZ8483okNnRwBqs4vlViPy2bxJagFBcDlIYVdg98TmgWai_Fs_Ai9mp500badjptJPFQm5fSRoL4PcEK3v1jGhawcz12c_VFZRa1X8-yCgA3Cqj1vvZBj1VuYWEpQpN3kzM_Jb9RLU/s72-c/responsive-adsense-ad-units.jpg
Experience Lab - Online business creation and development guide for bloggers and startups
https://www.experiencelab.info/2013/10/how-to-create-responsive-ad-units-in.html
https://www.experiencelab.info/
https://www.experiencelab.info/
https://www.experiencelab.info/2013/10/how-to-create-responsive-ad-units-in.html
true
2959477579779989044
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share. STEP 2: Click the link you shared to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy