AdSense Asynchronous Ads with Responsive design is a quite difficult to manage or implement. Here are some ideas which might help you for HTML5 website. In previous two articles – Adsense Responsive Ads Guide For Coding and Planning and Using Responsive AdSense Ad Unit, we wrote about how to use the responsive ad units in your website. Now, Google AdSense has thought to go for Beta of AdSense. Possibly this AdSense Asynchronous Ads Beta feature is not available on all accounts.
AdSense Asynchronous Ads with Responsive Ads : The Basics We Are Taking You Know
AdSense Asynchronous Ads with Responsive Ads becomes a difficult problem to use for various reasons :
- <ins> element is used to define the stylesheet, refer the unit and account. People in general has less idea about <ins> in HTML5.
- The whole code actually calls an iframe – its not actually an image in the Ads, so its not really the fact that a CSS can easily make it looking small.
- Even if CSS is used for mobile devices, the channel control is actually lost.
- Other methods of injection is very very difficult for even a programmer to implement.
AdSense Asynchronous Ads with Responsive Ads : The possible ways
The possible best way will be to use only squarish Ad units – practically no change will be required. But unfortunately, most of us has a leaderboard unit. Typical Asynchronous Ad code will be :
By the way, you can :
- Delete the indentations in the ins class
- You can include the adsbygoogle.js only once.
The first method is the best method :
I personally do not like the other methods described by the others for various reasons. Basically, what James Foster has done is to separate the CSS part and make it responsive. He rightly pointed out the ‘side-effects’ too.
Other ways we want to emphasize are :
- Using Server side scripting to recognize the device and deliver the right unit.
- Using jRespond (on GitHub) in modified way to change the parameters
Server side scripting can be done with PHP. In almost all of these cases, you need to save the code of one unit as Text file and call it. Example idea :
AdSense Asynchronous Ads with Responsive Ads : Why We Are Not Using
There is definite issue with Ad targeting – people are complaining of viewing Arabic Ads, Chinese Ads plus a possible issue with Analytics is apparent. Definitely, participate in Beta testing at dev site.