I have Google Analytics set up on several sites and I just compared your code with mine.
The only difference I could see, was in the following lines:
var ga = document.createElement('**script');
var s = document.getElementsByTagName(**'script');
On my sites these lines read:
var ga = document.createElement('script');
var s = document.getElementsByTagName('script');
i.e. there is no double asterisk proceeding the word script.
Other than that, it might be the case that Google Analytics takes a while to start tracking a site.
I have no idea if this is relevant, but hope it helps anyway.