• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 Responsive adsense

upnet

Active member
#1
I am using responsive adsense in ad_message_below and on mobile it works great, but on desktop the ad often covers the post before. Any easy fix for this?

Code:
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- responsive header -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="vbnvbnvbnvbnvbn"
     data-ad-slot="nvbnvbnvbnvbnb"
     data-ad-format="auto"></ins>
     
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
 

Attachments

upnet

Active member
#3
Ok now I have that code with async responsive adsense unit. Not getting anything displayed though?

Code:
<div style="text-align: center; padding: 8px 0 4px 0; border-bottom: 1px solid @primaryLighterStill">
          <script type="text/javascript">
            google_ad_client = "234234234234";
            width = document.documentElement.clientWidth;
           
            google_ad_slot = "234234234";
            google_ad_width = 300;
            google_ad_height = 250;
               
                    if (width > 743) {
                    /* Thread List Below Stickies */
                    google_ad_slot = "23423423";
                    google_ad_width = 728;
                    google_ad_height = 90;
                    }
            </script>

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js">           
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>