Welcome to WebmasterWorld Guest from 18.204.48.199

Forum Moderators: martinibuster

Message Too Old, No Replies

Hide ads on a specific device via CSS

are we alowed to hide ads via css

     
8:58 pm on Jul 19, 2018 (gmt 0)

Junior Member from FR 

joined:July 29, 2017
posts: 49
votes: 2


Hi guys!

I am using "Ionmag" as a template for my website. it has an option for ad spots. within each ad sport there are options allowing to disable or enable ad unit on specific device. to make it work they use CSS. I have read somewhere that using CSS is against adsense TOS.

could you elaborate please ?
9:43 pm on July 19, 2018 (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:4558
votes: 363


CSS against AdSense TOS? Um, CSS styles most every site online if they aren't using antiquated code. There is no reason to believe such advice. It is possible that someone was thinking of "cloaking" being against Google's guidelines. That means hiding some content for some visitors or showing different content to different visitors. That is not the same thing as tailoring content (or ads) to devices.
11:26 pm on July 19, 2018 (gmt 0)

Senior Member

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

joined:Dec 12, 2004
posts:662
votes: 15


It is OK to hide ads using CSS, see the last example here: [support.google.com...]

Make sure that display:none is applied before the ad code is executed/loaded - you can inspect the ad slot code, and look for '<!--No ad requested because of display:none on the adsbygoogle tag-->' comment to make sure. Also some new native ad units don't support hiding: for example in-feed ads throw an error.
12:00 pm on July 20, 2018 (gmt 0)

Junior Member from FR 

joined:July 29, 2017
posts: 49
votes: 2


Thank you guys for taking the time to answer my question!