Forum Moderators: martinibuster

Message Too Old, No Replies

Which ad code to use for responsive page?

         

born2run

11:46 pm on Apr 8, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi so I've not been using Adsense for a couple of years until now, & I wanted to seek advice here.

My site is responsive which is that it shows a desktop view (multi-column etc) for desktop users and a single column view for mobile visitors.

What adsense code should I use that is responsive, and works in both desktop (horizontal adsense banner) and mobile mode (square adsense banner)?

Or I would have to use CSS (media queries) to place different size adsense banners for the same place on the page to handle different viewport sizes? I would appreciate some help. Thanks!

born2run

5:20 pm on Apr 9, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Anyone want to help? Thanks! :)

vivalasvegas

1:20 pm on Apr 19, 2022 (gmt 0)

10+ Year Member



It depends on how much control you want on the size of ads shown on your pages. Placing a responsive ad is the easiest, but do test on both mobile and desktop to see if you like the outcome.

Google gives you the option to control ad size [support.google.com], especially ad height I have found important.

One of the options I like is setting the data-full-width-responsive="true" - this will expand an ad to 100% width on mobile screens. Unfortunately it doesn't seem to work with fixed ad height.