Google Analytics not working

Could someone please look at my code here:

<script type=“text/javascript”>
var _gaq = _gaq || ;
_gaq.push([‘_setAccount’, ‘UA-33318600-1’]);
_gaq.push([‘_setDomainName’, ‘’]);

    (function() {
    var ga = document.createElement('**script'); ga.type =
    'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : '
    http://www') + '';
    var s = document.getElementsByTagName(**'script')[0];
    s.parentNode.insertBefore(ga, s);

I have inserted the Google Analytics tracking code provided to me, copied & pasted directly yet Analytics continually says that the tracking code has not been set-up. I have double checked the UA numbers and they are the ones corresponding to their account.

What could be the problem?


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(

On my sites these lines read:

var ga = document.createElement(‘script’);
var s = document.getElementsByTagName(‘script’)[0];

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.

In the past we had the following problem in our site <snip>. When the new version was launched, we made a PHP script that was sending us an email each tome somebody enters a page. The email was containing the page’s name and visitor’s IP. So within one day we were receiving much more emails rather than the number of visitors displayed in Google Analytics. So I don’t trust it much.