Making the Woopra analytics code valid xHTML


Woopra is a ground-breaking web-analytics service that is seriously better than Google Analytics. However, the default javascript code is flawed, in the sense that it doesn’t validate as xHTML strict.

The default code looks like this :

[js]
var woopra_id = ‘XXXXXXXXXX’;

where ‘XXXXXXXXXX’ is the website ID.

To make this valid xHTML, you just need to add type="text/javascript" to the second script tag; so that your code looks like this :

[js]
var woopra_id = ‘XXXXXXXXXX’;

PS : Those of you who are using the Woopra WordPress plugin, you don’t need to worry about this. The plugin produces the valid xHTML code by default.