Google analytics does not work


Active member
I input my google analytics code in the text box in Statistics and Metrics.

When I login to and try to verify my website, it gives me error

Tracking Not Installed (Last checked: Oct 24, 2010 7:05:09 AM )
The Google Analytics tracking code has not been detected on your website's home page. For Analytics to function, you or your web administrator must add the code to each page of your website.
It is asking me to put in the following code
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-4196716-16']);

  (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);

When I check my page source the following code is present
<script type="text/javascript"> 
	var _gaq = [['_setAccount', 'UA-4196716-16'], ['_trackPageview']];
	!function(d, t)
		var g = d.createElement(t),
			s = d.getElementsByTagName(t)[0];	
		g.async = true;
		g.src = ('https:' == d.location.protocol ? 'https://ssl' : 'http://www') + '';
		s.parentNode.insertBefore(g, s);
	(document, 'script');

The code that google analytics is asking me to put is not the same as the one that Xenforo is putting in my webpages.

Is this a bug? Any suggestions on what I should do? I am going to modify my footer template and add the code in there.

Jake Bunce

XenForo moderator
Staff member
1) When you verify your site with Google be sure to enter the URL of your forum.

2) Try reverting these templates if they are customized:

Admin CP -> Appearance -> Templates
> google_analytics

steven s

Well-known member
Analytics is picking up my site, so I assume it's not a bug.
I have similar code on my page.
Is your site viewable to the public?


I've went to my analytics account and created 2 new ones when I moved 2 sites over to xenforo

1 was vb import to xenforo
1 was fresh install

both got unique codes, and the first one has stats, the second one didn't.

I've set up 2 more profiles and added the code to two more sites of friends of mine, and we will see in a week how it goes.