SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2012
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    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.

    However...

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

    Code:
    <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 therevcounter.com/forum

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

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Location
    Augusta, Georgia, United States
    Posts
    4,147
    Mentioned
    16 Post(s)
    Tagged
    3 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
    Location
    Sydney, NSW, Australia
    Posts
    16,812
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Try comparing the code you are using with the code that Adsense says that you should be using.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Bookmarks

Posting Permissions

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