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 kuyenmotdivad, Mar 13, 2011.

  1. kuyenmotdivad

    kuyenmotdivad Active Member


    How do I install Google Analytics I put the code from "Reports" into the "Statistics and Metrics", then if I goto this page, image below. Did I set it up right, I'm new on this Analytics stuff. :confused:

    The reason i'm wondering is its got 0 visitors and everything else is 0 or is it cause I only registered 20mins ago?
  2. Brogan

    Brogan XenForo Moderator Staff Member

    That's correct.
    You need to wait for Google to update the stat's.
  3. kuyenmotdivad

    kuyenmotdivad Active Member

    Thanks, So google only update every so often, if I goto this site it says its not configured right if I type in my URL : http://checkwebsite.erigami.com/googleanalytics.html
  4. Ati

    Ati Active Member

    In the screenshot above you are looking at stats for March 12. Today is March 13. If you just installed it today, then there will be no data for yesterday.

    And also, as Brogan said, it takes a while for the stats to be updated. Sometimes you have to wait a few hours for new data to be added. It's not real-time.
  5. Brogan

    Brogan XenForo Moderator Staff Member

    I wouldn't take any notice of that page.
    It claims mine isn't working either.
  6. kuyenmotdivad

    kuyenmotdivad Active Member

    Thanks guys most helpful. (y)
  7. gldtn

    gldtn Well-Known Member

    What the best place or way to install google analytics into Xenforo?
  8. Brogan

    Brogan XenForo Moderator Staff Member

    In the ACP -> Options -> Statistic and Metrics: Google Analytics Web Property ID
    Sej and gldtn like this.
  9. gldtn

    gldtn Well-Known Member

    Awesome, Thanks Brogan!
  10. swatme

    swatme Well-Known Member

    just a followup question

    i already added the my Google Analytics Web Property ID in
    ACP -> Options -> Statistic and Metrics:

    now do i have to put also the code gave by google
    in the php files of xf?

    if yes where specifically what file?

  11. Brogan

    Brogan XenForo Moderator Staff Member

    Entering the code in the ACP is all you need to do.
  12. Ryan Kent

    Ryan Kent Well-Known Member

    I am setting up Google Analytics for my site. About a month ago I added the GA id into the ACP during my initial set up. A couple follow up questions:

    - by adding the info in the ACP then XF automatically sends google the correct info for all pages within the site?

    - if so, does that include extra pages we create with add-ons such as our portal page? wiki pages? etc?

    - Google suggests we enter a code snippet at the end of every page and I just want to ensure I don't need to do such.

    - Also, I am not clear what the "Default Page" is for my site. I know it is my portal page, but I don't know if it is index.html or ? Google asks "The Default page is the webpage to which your server defaults when no page on the domain is specified. For example, if the "index.html" page is loaded from your server when a user enters "www.yourdomain.com", "index.html" is considered to be the Default page."
  13. Brogan

    Brogan XenForo Moderator Staff Member

    Just enter the code in the ACP, it is automatically inserted into every page due to a template include in the PAGE_CONTAINER template.

    The default page is the page which is loaded when you browse to your domain - www.example.com

    Turn off friendly URLs and you will see the actual URL of the portal page - I don't have it installed so don't know what it is.
    Oracle likes this.
  14. Sadik B

    Sadik B Well-Known Member

    For those who are not sure if GA is working for you or not, just view the page source and you should have Google's analytic code on there.

    It would be something like this, with your Analytics ID.

    <script type="text/javascript">
        var _gaq = [['_setAccount', 'UA-10855523-4'], ['_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');
    Oracle likes this.
  15. bluepaw

    bluepaw Member

    I have setup the Google Analytics code on my page, however it seems the XenForo is not setup for the tracking of subdomain format?
    Is it planned in future releases to change to support GA subdomains? or is it possible to edit the code that is being generated?

    This is what google generated for use with subdomains:
    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-XXXXXXXX-X']);
      _gaq.push(['_setDomainName', 'mydomain.com']);
      (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);

Share This Page