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

Google Analytics

Discussion in 'Troubleshooting and Problems' started by Eoj Nawoh, Jan 22, 2013.

  1. Eoj Nawoh

    Eoj Nawoh Active Member

    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 
    document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gas);
      })();
     
    </script>

    Xenforo Code:
    PHP:
    <xen:if is="{$xenOptions.googleAnalyticsWebPropertyId}"><script>
     
        var 
    _gaq = [['_setAccount''{$xenOptions.googleAnalyticsWebPropertyId}'], ['_trackPageview']];
        !function(
    dt)
        {
            var 
    d.createElement(t),
                
    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(gs);
        }
        (
    document'script');
     
        
    </script><xen:comment><!--Adapted from http://mathiasbynens.be/notes/async-analytics-snippet--></xen:comment></xen:if>
     
  2. MattW

    MattW Well-Known Member

    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.
     
  3. Eoj Nawoh

    Eoj Nawoh Active Member

    Yes, I tried and Google says "Status: Tracking Not Installed"
     
  4. MattW

    MattW Well-Known Member

    Your site is loading the google analytics js, so it looks like it's trying to load it
    analytics.PNG
     
  5. Eoj Nawoh

    Eoj Nawoh Active Member

    So what is the problem then?

    I am not quite sure on the possible issues it could be facing.
     
  6. Eoj Nawoh

    Eoj Nawoh Active Member

    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. theBeaz

    theBeaz Member

    Did you do anything additional to make it work? I'm having the same issue with "Tracking Not Installed".
     
  8. RoldanLT

    RoldanLT Well-Known Member

    Try rebuilding your templates.
     
  9. Eoj Nawoh

    Eoj Nawoh Active Member

    I waited like two days and it worked.

    However, I will ask any way to get the additional settings working.
     

Share This Page