Making Adsense Responsive

戏子无情 提交于 2019-12-30 08:26:29

问题


I'm a site owner, currently using Adsense to monetize. I've decided to change my site design to a responsive design so that the website can present itself appropriately on a variety of screen sizes, but unfortunately Adsense isn't very flexible with regards to this. It's relatively simple to simply hide large desktop advertising when the screen width gets too small, but this isn't good for revenue and from what I've read might be against Google's Terms Of Service.

Can anyone think of any way to do something with Adsense so it works intuitively with a responsive design?


回答1:


Google now has Responsive ad units: https://support.google.com/adsense/answer/3543893




回答2:


I guess, under your account you might be set up several AdSense units for several dimensions Google offers. Then with Javascript on page load, decide what ad unit to use, based on the screen width and list of available unit dimensions, and inject the corresponding AdSense unit HTML code dynamically:

This should allow you to progressively downgrade the ad width to as low as 120 pixels. Don't know about the TOS however, but the technique looks fairly legal to me.

If for example jQuery would be used and the advertisement should be placed right after the main page title <h1>, something like this would do:

$('The HTML code for the AdSense unit goes here').insertAfter('h1');



回答3:


You really haven't provided enough information. As you obviously know a "responsive design" can be as simple as floating your content so elements slide underneath each other when they don't fit horizontally.

Therefore you can just float your Adsense iframe to either side of your floated content and drop it underneath everything else when it doesn't fit on screen.

However since you haven't provided a link or any details about your site I have no idea whether that would be acceptable to you. Given you can't change the scale of the AdSense without creating problems for yourself I don't see any other choice you have.




回答4:


Based on your subresponse, it sounds like this is a mobile ad unit issue. Note that Adsense isn't going to count a web display size (ie: 728x90) on a mobile unit, even if it shows up when you view the page on your mobile browser.

Instead you should use a mobile banner (ie: 320x50) on your mobile page.

Let me know if you have any more questions.



来源:https://stackoverflow.com/questions/9366048/making-adsense-responsive

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!