Hi guys,
Long time lurker signed up to ask a burning question :)
Since we have redesigned our website to be fully responsive our adsense revenue for mobile has dropped to a ridiculous level.
Our site has two rectangle ads in the left sidebar that perform steady for desktop traffic but due to the ads being placed all the way down the site on a narrow mobile device I need to rework the placements of our "mobile" ads with responsive adsense.
Google now allows publishers to use display: none on responsive adsense code to hide content on small screens (see [
support.google.com...] ) however I'd like to achieve the opposite. Hide an ad unit on the largest screens and only show them on mobile/tablet devices.
Using the trick in the link above simply using display: none won't hide the largest media query. Although when using the following code with display: none !Important; it does the job just fine.
<style>
.test { width: 320px; height: 50px; }
@media(min-width: 801px) { .test { display: none !Important; } }
</style>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- test -->
<ins class="adsbygoogle test"
style="display:inline-block"
data-ad-client="ca-pub-XXXXXXX"
data-ad-slot="XXXXXXX"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
Is the use of display: none !Important; allowed to hide adsense for desktop users? If so, my problems are finally solved and I can work on new mobile ad positions.
Thanks for the help!
[edited by: martinibuster at 2:15 am (utc) on Sep 8, 2014]
[edit reason] Fixed URL/"examplified" elsewhere. [/edit]