Forum Moderators: martinibuster

Message Too Old, No Replies

Hide ads on a specific device via CSS

are we alowed to hide ads via css

         

Nazhahp

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

5+ Year Member Top Contributors Of The Month



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 ?

not2easy

9:43 pm on Jul 19, 2018 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



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.

levo

11:26 pm on Jul 19, 2018 (gmt 0)

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



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.

Nazhahp

12:00 pm on Jul 20, 2018 (gmt 0)

5+ Year Member Top Contributors Of The Month



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