AdSense nonsense

Posted Aug 16, 2004 in JavaScript, Making Ends Meet, si-blog, Technology.

Some readers may have noticed that I have been experimenting with Google's AdSense advertising. I have introduced it to my archive page for the moment, and it may find its way on to others at a later date. Unfortunately, only about 50% (currently) of my readership will be able to see them.

The problem lies with the JavaScript used to power AdSense. Google's script uses Document.Write() to create an inline frame for the ads. I use content negotiation to serve up my pages as application/xhtml+xml to those user agents that like it. Unfortunately, Document.Write() just doesn't work in those circumstances. That means that only those user agents getting text/html will see the AdSense iframe. I contacted Google about it, and got this reply:

Thank you for your email. We understand that the AdSense code cannot be used with pure XHTML. We appreciate your feedback on this matter and encourage you to continue to let us know how we can improve Google AdSense. As AdSense is still a young program, new features are under consideration and your feedback is very helpful.

Bummer. I would guess that many people have asked the same question, since that seemed like a pre-written response. In a way, that is sort of good to hear, because it means that many people must be serving their pages in some form of XML. That isn't going to help me make a million bucks though, is it? I know of no way to get around this, since it is a problem at Google's end.


  1. Gravatar

    Yes, I just noticed that and I must say that not being able to get money WHILE serving content as application/xhtml+xml is anoying. Oh well, soon though.

    Posted by noderat on Aug 20, 2004.