1. 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

Discussion in 'Styling and Customization Questions' started by upnet, Jul 7, 2016.

  1. upnet

    upnet Active Member

    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?

    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <!-- responsive header -->
    <ins class="adsbygoogle"
    (adsbygoogle = window.adsbygoogle || []).push({});

    Attached Files:

  2. Brogan

    Brogan XenForo Moderator Staff Member

    upnet likes this.
  3. upnet

    upnet Active Member

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

    <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 async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js">           
    (adsbygoogle = window.adsbygoogle || []).push({});
  4. Brogan

    Brogan XenForo Moderator Staff Member

    It takes a while for AdSense to start serving ads.

Share This Page