• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Google analytics does not work

#1
I input my google analytics code in the text box in Statistics and Metrics.

When I login to google.com/analytics and try to verify my website, it gives me error

Code:
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
Code:
<script type="text/javascript">

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

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

</script>
When I check my page source the following code is present
Code:
<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') + '.google-analytics.com/ga.js';
		s.parentNode.insertBefore(g, s);
	}
	(document, 'script');
	//-->
	</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
#2
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
> PAGE_CONTAINER
> google_analytics
 

steven s

Well-known member
#3
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?
 
F

Floris

Guest
#4
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.