Welcome to WebmasterWorld Guest from 34.204.169.76

Forum Moderators: martinibuster

Message Too Old, No Replies

ads in hidden DIVs for responsive layout?

     
3:18 pm on Oct 11, 2017 (gmt 0)

Junior Member

joined:Sept 25, 2016
posts: 62
votes: 19


I have a responsive layout where one column is visible only on desktop. There is a skyscraper ad in that div.
On a mobile that column and ad are not visible.

1. Is this legal by Adsense's terms and conditions?

2. Could this harm me by inflating ad-loads when it is not viewable? Dont some browsers still load images, etc in hidden divs? Could these background loads hurt the performance stats and therefore my payouts?

3. If the answer to either question indicates that what I'm doing is wrong, can anyone suggest how to best hide an ad for certain devices in a responsive layout?

Thanks!
6:04 pm on Oct 11, 2017 (gmt 0)

Senior Member from US 

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

joined:Sept 26, 2001
posts:12913
votes: 893


1. Yes

2. The code will be parsed but not displayed by the browser. Very little hit on load time.

3. Unless you are doing this in an uncommon way, you should be fine.

Most all responsive layouts use CSS to show some ads and not others depending on device screen size.
6:27 pm on Oct 11, 2017 (gmt 0)

Senior Member

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

joined:Dec 12, 2004
posts:657
votes: 13


You can inspect the hidden element to be sure. Google leaves following comment inside it.

<!--No ad requested because of display:none on the adsbygoogle tag-->
6:50 pm on Oct 11, 2017 (gmt 0)

New User

joined:Nov 15, 2015
posts: 39
votes: 2


Hi Westcoast,
I use the recommended code from Google to do exactly what you are looking for. Here's their Help page on the topic
[support.google.com...]
7:49 pm on Oct 11, 2017 (gmt 0)

Senior Member

WebmasterWorld Senior Member Top Contributors Of The Month

joined:Apr 1, 2016
posts:2662
votes: 793


@westcoast
1. Absolutely not. You must be sure that if you do not wish not to display an ad-unit that its tag is set to display:none such that the ad is not called on page load. Otherwise the ad will be displayed but be hidden from users, and this is a policy violation. If it isn't flagged as a violation, then it will destroy your AVV as the hidden ads will drag the metric down and this can impact earnings. Be sure that if an ad is hidden the js is not executed.
2. See answer one.
3. Follow the instructions in the link submitted by @jbnz
8:33 pm on Oct 11, 2017 (gmt 0)

Senior Member from US 

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

joined:Sept 26, 2001
posts:12913
votes: 893


1. Absolutely not. You must be sure that if you do not wish not to display an ad-unit that its tag is set to display:none such that the ad is not called on page load.
That's what he said, unless I'm not understanding his intent.
2:58 am on Oct 12, 2017 (gmt 0)

Full Member

5+ Year Member Top Contributors Of The Month

joined:Aug 14, 2014
posts:315
votes: 99


Ya. I thought there was a specific way they wanted you to go about it:

Techniques to avoid
Here are some techniques you’ll want to avoid:

Hiding ad units at anytime (e.g., display:none), unless you're implementing a responsive ad unit.

[support.google.com...]
11:37 am on Oct 12, 2017 (gmt 0)

Junior Member

5+ Year Member

joined:Mar 9, 2012
posts: 112
votes: 23


I've been using @westcoast solution for about two years without repercussions but I'll try the "right" approach and see if my AVV increases.