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

XF 1.2 Can I upgrade to Universal Analytics by Google?

Discussion in 'XenForo Questions and Support' started by Moshe1010, Nov 25, 2013.

  1. Moshe1010

    Moshe1010 Well-Known Member

    Google claims they've changed their analytic code with Universal Analytics.
    Since Google's code is implemented in XenForo, I'm wondering if I can upgrade to Universal Analytics and it would still work?
    From their website:

    https://developers.google.com/analytics/devguides/collection/upgrade/

    https://developers.google.com/analytics/devguides/collection/upgrade/guide


    Or do I need to edit google_analytics and replace it with:

    Code:
    <xen:if is="{$xenOptions.googleAnalyticsWebPropertyId}">
    <!-- Google Analytics -->
    <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
    
    ga('create', '{$xenOptions.googleAnalyticsWebPropertyId}', 'auto');
    ga('send', 'pageview');
    
    </script>
    <!-- End Google Analytics -->
    </xen:if>
    ?
     
  2. Mike

    Mike XenForo Developer Staff Member

    If you have different needs/configurations, I'd always recommend changing the GA code to whatever Google gives you for your setup.
     
  3. Mouth

    Mouth Well-Known Member

    Yes, but you won't get any of the new advanced tracking and statistics that Universal supplies.
    In time, I expect Google will deprecate all non-Universal tracking methods, and then finally remove all support.

    Unless your going to change to the javascript tracking code, there's no point in upgrading your Analytics to Universal until forced to do so.
     

Share This Page