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

Google Analytics

Eoj Nawoh

Active member
#1
Before I get "Go Search for threads", I did, but I added the Account ID to the statics page to no avail. The code seems to be different so perhaps that has influenced it, or am I wrong?

My Code:

PHP:
<script type="text/javascript">
 
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-37875431-1']);
  _gaq.push(['_setDomainName', 'harpoongaming.com']);
  _gaq.push(['_setAllowLinker', true]);
  _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>

Xenforo Code:
PHP:
<xen:if is="{$xenOptions.googleAnalyticsWebPropertyId}"><script>
 
    var _gaq = [['_setAccount', '{$xenOptions.googleAnalyticsWebPropertyId}'], ['_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><xen:comment><!--Adapted from http://mathiasbynens.be/notes/async-analytics-snippet--></xen:comment></xen:if>
 

MattW

Well-known member
#2
What are you trying to do? Just get analytics working with your site? All you should have to do is enter the "Google Analytics Web Property ID" into the Statistics and Metrics section in the admin control panel.
 

Eoj Nawoh

Active member
#3
What are you trying to do? Just get analytics working with your site? All you should have to do is enter the "Google Analytics Web Property ID" into the Statistics and Metrics section in the admin control panel.
Yes, I tried and Google says "Status: Tracking Not Installed"
 

Eoj Nawoh

Active member
#6
Not to double post, but it is now working, although if I want to include more data, such as subdomain tracking, I have to change the code, how might I do this?
 
#7
Not to double post, but it is now working, although if I want to include more data, such as subdomain tracking, I have to change the code, how might I do this?
Did you do anything additional to make it work? I'm having the same issue with "Tracking Not Installed".