Welcome to WebmasterWorld Guest from 3.227.233.6

Forum Moderators: not2easy

Message Too Old, No Replies

Fixed footer that's Adsense compliant

     
8:13 am on Apr 30, 2017 (gmt 0)

Senior Member

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

joined:Mar 15, 2013
posts: 1139
votes: 115


It's my understand that Adsense doesn't approve of an ad being hidden behind another layer. So with that in mind...

On tablets and mobile devices, I'm showing locally-sold ads using a simply:

position: fixed;
left: 0;
bottom: 0;
height: 50px;
width: 100%;
background: #999;
z-index: 10000;


I want the locally-sold ad (NOT the Adsense banner) to stay fixed on the bottom of the viewport while the user scrolls up and down. But I also have 728x90 (tablets) or 300x50 (mobile) Adsense banners that will scroll with the page, and I have to worry that them scrolling behind the local ad will be a violation.

If that's true, what's a smart way to accomplish this without violating Adsense policies?
3:22 pm on Apr 30, 2017 (gmt 0)

Administrator from US 

WebmasterWorld Administrator not2easy is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 27, 2006
posts:4391
votes: 310


Does the AdSense container scroll to the "bottom: 0;" position or is it scrolling within the main container? I ask because the fixed-bottom position can be outside the footer and show in the same place. Or you could change the z-index to "-2" or assign the z-index of the AdSense ad to "11000".


9:08 pm on Apr 30, 2017 (gmt 0)

Senior Member

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

joined:Mar 15, 2013
posts: 1139
votes: 115


The Adsense container doesn't have any positioning set, so it's just at the default position: static. The mobile and tablet Adsense containers are nested within the HTML5 <main></main> tag, and the local ad is at the very bottom of the <footer></footer> tag.

I could easily set the Adsense containers to position: relative and give them a z-index: 11000, so that when the user scrolls at one point the layers would be:

MAIN
LOCAL
ADSENSE

It would look kinda weird, though, I think. And would Adsense be OK with that, or would they consider that to be calling attention to the Adsense banner?