*

Darwazo

  • ***
  • 81 posts
Hide Adsense Ads on mobile
« on: April 26, 2019, 01:20:44 PM »
Hi Guys,

i am looking for some help....
I want to hide responsive adsense ads in mobile view......
I tried below method but didnt work for me on VERONIKA theme



I want ads  in footer of website on desktop view but should be disabled / hide on mobile view.
I pasted below code in footer  but mobile is still showing up ads !!
Below code is suggested by google :

https://support.google.com/adsense/answer/6307124



<style>
. reponsive_nagi_0 { width: 320px; height: 100px; }
@media(min-width: 500px) { . reponsive_nagi_0 { width: 468px; height: 60px; } }
@media(min-width: 800px) { . reponsive_nagi_0 { width: 728px; height: 90px; } }
</style>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- reponsive_nagi_0 -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-90xxxxxxxxxxxxx"
     data-ad-slot="451xxxxxx"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>


NOTE:
Changed Ad client and slot Codes !!

Thanks in advance

*

MB Themes

Re: Hide Adsense Ads on mobile
« Reply #1 on: April 26, 2019, 02:14:47 PM »
Maybe this?
<style>
@media(max-width: 760px) { .adsbygoogle { display:none!important} }
</style>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Darwazo

  • ***
  • 81 posts
Re: Hide Adsense Ads on mobile
« Reply #2 on: April 26, 2019, 04:06:55 PM »
didn't work for me ...........
« Last Edit: April 26, 2019, 05:27:55 PM by Darwazo »

*

Darwazo

  • ***
  • 81 posts
Re: Hide Adsense Ads on mobile
« Reply #3 on: April 27, 2019, 03:38:24 AM »
i managed to put like this and achieve objective :)

 <style>
.reponsive_nagi_0 { width: auto; height: auto; }
@media(min-width: 300px) { .reponsive_nagi_0 { Display: none; } }
@media(min-width: 800px) { .reponsive_nagi_0 { width: 728px; height: 120px; } }
</style>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- reponsive_nagi_0 -->
<ins class="adsbygoogle reponsive_nagi_0"
     style="display:inline-block"
     data-ad-client="ca-pub-90050XXXX"
     data-ad-slot="45103XXXX"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>