Google AdSense and XHTML1.1


Visitors using older browsers like IE might have noticed that I recently started serving advertisements through Google.

People using more modern browsers as Mozilla or Firebird might not have noticed this, since these advertisements are not visible for them. This is not because I want to tease IE users (everybody is free to use any software to visit my site), or give compliments to Moz users (their clicks are also worth some money), but only because Google’s scripts are not working when send as application/xhtml+xml. I found the following errors in my Javascript console:

Error: w.google_ad_client has no properties Source File: Line: 37 Error: google_ad_width is not defined Source File: Line: 128

Of course I reported these errors to Google, but all I received was the following reply:

Hello Jeroen,

The errors that you were experiencing last night were due to an AdSense system upgrade yesterday evening. This upgrade unfortunately created some technical difficulties and were temporarily unable to serve ads to sites in certain browsers. Not all browsers were effected.

However, our engineers have identified the problem, and I am happy to inform you that the issue is now resolved. Ads are now running on AdSense websites and you should not be seeing these errors anymore.

We value you as an AdSense publisher, and sincerely apologize for any inconvenience we may have caused you. If you are continuing to have problems with this or have any other questions or concerns, please let us know by replying to this email. One of our AdSense specialists would be happy to assist you. Thank you for your patience in this matter.


The Google Team

Of course I answered them that the problem still exists, but until now I haven’t received an answer.

[Update 2003.09.26] Answer from Google:

Hello Jeroen,

Thank you for writing us about this issue you are experiencing with your AdSense code. Unfortunately we are unable to replicate this problem. We taking your page,, and running it through the W3C’s XML validator tool (, we find that the entire page including our JavaScript code is currently XML complaint. (See Results: Unfortunately we are unable to replicate this problem you are experiencing.

From previous emails it appears you state you are having this problem in Mozilla 1.4. Here is a list of browsers that supports our code Are there other browsers on this list that you are having difficulty with? Also can you include a screenshot of the error since we are unable to replicate this problem on our end. Please include any additional information you may find may be useful in helping to resolve this issue.


The Google Team

It looks like they don’t understand anything about specifying the MIME type when sending a page, so I send the following reply.


I know that my page is XML compliant, that surely is not the problem.

You have not been able to replicate the problem, because you have not used a gecko-based browser. Normally I send my pages with MIME type text/html. This is what IE and the W3C validator get. Only to browsers which tell me in their request headers that they accept the MIME type application/xhtml+xml (like Mozilla and Firebird), I use this MIME type to send my files.

Note that even though the validator did not complain, I did not send it a valid page, since the specification tells that XHTML1.1 should be delivered as application/xhtml+xml.

To reproduce the error, just visit my page with Mozilla or Firebird, and you will see that the AdSense box will not appear. The only screenshot I can send you is the JavaScript console, but it only contains the two messages I have send before.

Kind regards,

Jeroen Sangers

[Update 2003.10.01] And finally Google realises that their script is not working:

Hello Jeroen,

We appreciate your taking the time to offer us this feedback 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. This information has been passed on to our engineers and they will look into allowing our ads to be served in xhtml+xml pages.

Sincerely, The Google Team

It took them almost a month (I reported this problem on September 4th) to realise that something is wrong. Let’s see how long it will take them to fix this problem.

Jeroen Sangers @jeroensangers