Hiding Automatic Adsense Ads on Mobile

SelamT

Active member
Hello,

I use Google AdSense ads that are automatically added to my site.

Can something be done to ensure that users who are logged into my site from a mobile device do not see ads?

Thanks,
 
Solution
I'm trying to remember how this works. Are they added by Google irrespective of an ad code placement?

If they rely on an ad code in the xenForo advertising system then it is easy enough to hide that code from logged in users with the ad position settings: User is NOT a member of any of the selected user groups: registered, and hide on mobiles with CSS in extra.less by wrapping it in a div with class

e.g. <div class ="nomobile">AD_CODE </div>

and in extra.less

Code:
@media (max-width: @xf-responsiveMedium)
{.nomobile
{
display:none
}}
I'm trying to remember how this works. Are they added by Google irrespective of an ad code placement?

If they rely on an ad code in the xenForo advertising system then it is easy enough to hide that code from logged in users with the ad position settings: User is NOT a member of any of the selected user groups: registered, and hide on mobiles with CSS in extra.less by wrapping it in a div with class

e.g. <div class ="nomobile">AD_CODE </div>

and in extra.less

Code:
@media (max-width: @xf-responsiveMedium)
{.nomobile
{
display:none
}}
 
Solution
Back
Top Bottom