I have recently redesigned my website to a responsive design and everything is working great. The only issue is, the current desktop ads are incompatible with the responsive design. I have discovered a method to hide the desktop ads on mobile, but can;t seem to find a way to only show responsive ads on mobile,tablets,etc (anything but desktop) so that I can create new ad positions for these. My current adsense code is in the format
<script async src="//"></script>
<!-- MH Responsive -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-xxxxxxxx"
data-ad-slot="xxxxxx"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
Any help on this matter would be greatly appreciated.
Kindest Regards
The way I would do it, I would use PHP code. Here is the code:
(adsbygoogle = window.adsbygoogle || []).push({}); '; } }?>Place that script at the top of the page and when you want to show the ad just paste this script: