SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2012
    0 Post(s)
    0 Thread(s)

    Issues with Adsense Javascript

    Hello all,

    Hopefully I am posting this in the right section...

    To cut a very long story short I run Adsense banners on my site however these are not displaying, I simply get a empty space where the banner should be. Now you are probably thinking "what has this got to do with javascript", please bear with me.

    While diagnosing the problem I have used PageSpeed to see what requests/responses are being handled by the browser. I can see that the browser is making a call out to the Google Adsense scripts, and I can a response coming back. This response is effectively a chunk of javascript which I assume to be the necessary markup to render the banner.


    As mentioned above no banner is displayed, if I view the source of the iframe that adsense creates the source only contains:

    <html><body style="background-color:transparent"></body></html>
    Whereas other sites that run Adsense have the response javascript in the body element. Which explains the empty space where the banner should be. It doesn't however explain where the code isn't there.

    This is something that is effecting every site user as banner impressions have dropped to zero - so it isn't localised to a machine having, for example, javascript disabled.

    I think that there is something in my markup that is preventing the Adsense code from working properly. Problem is I have no idea what this could be. So the question is, could anybody point me in the direction of things to check.

    If it helps at all the url for the site is

    Many thanks
    Last edited by DragonTree; Aug 15, 2012 at 11:37. Reason: various typos

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Augusta, Georgia, United States
    16 Post(s)
    4 Thread(s)
    The iframe src attribute is referencing a URL that is throwing a 403 error. Which means you are not allowed to access the content. Perhaps an authentication configuration issue.
    The only code I hate more than my own is everyone else's.

  3. #3
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Sydney, NSW, Australia
    25 Post(s)
    1 Thread(s)
    Try comparing the code you are using with the code that Adsense says that you should be using.
    Stephen J Chapman, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts