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

Google Analytics code different?

RobParker

Well-known member
#1
I've added my GA account via my ACP and it's tracking but the code that's automatically inserted is different to the one to be manually inserted from my GA admin page.

XF automatically inserts:
Code:
<script>
   var _gaq = [['_setAccount', 'UA-XXXXXX-1'], ['_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>
Whereas the code that GA says to insert is:

Code:
<script type="text/javascript">

 var _gaq = _gaq || [];
 _gaq.push(['_setAccount', 'UA-XXXXXX-1']);
 _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>
Is this difference significant at all?