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

XF 1.4 Where to put google analytics tracking code

Discussion in 'XenForo Questions and Support' started by Michael Berg, Oct 17, 2014.

  1. Michael Berg

    Michael Berg New Member

    Want to add my site to google analytics--

    "To get all the benefits of Universal Analytics for this property, copy and paste this code into every webpage you want to track. "

    where would I paste the code?
     
  2. Steve F

    Steve F Well-Known Member

    ACP -> Options -> Statics and Metrics -> Google Analytics Web Property ID

    Enter just your Analytics ID in the field.
     
    Michael Berg likes this.
  3. Michael Berg

    Michael Berg New Member

    In google analytics there is a tracking code--which is javascript---

    and then there is User -ID thing--which is different.

    The Google Analytics Web Property ID is for web id or tracking code?
     
  4. Steve F

    Steve F Well-Known Member

    Just enter the "UA-********" id you have in the javascript.
     
    Michael Berg likes this.
  5. Michael Berg

    Michael Berg New Member

    So that would be in UA-xxxxxxx-x format?
     
  6. Steve F

    Steve F Well-Known Member

  7. Michael Berg

    Michael Berg New Member

    Thankyou
     
  8. Mike

    Mike XenForo Developer Staff Member

    Entering the option doesn't currently use the universal analytics. You can paste that JS code into the google_analytics template if you prefer.
     
  9. Michael Berg

    Michael Berg New Member

    Just append the tracking code to end of the existing code in google_analytics?
     
  10. Mike

    Mike XenForo Developer Staff Member

    Replace it entirely with whatever snippet Google gives you.
     
    Michael Berg likes this.
  11. Michael Berg

    Michael Berg New Member

    thanks and done
     
  12. Gladius

    Gladius Well-Known Member

    So, unless I'm missing something, it appears that the old GA code still hasn't been replaced with Universal in XF... why the delay?
     
    Mouth likes this.
  13. Do I insert the new script between the

    Code:
    <xen:if is="{$xenOptions.googleAnalyticsWebPropertyId}">
    script here
    Code:
    </script><xen:comment><!--Adapted from http://mathiasbynens.be/notes/async-analytics-snippet--></xen:comment></xen:if>
    lines?
     
  14. Gladius

    Gladius Well-Known Member

    Replace the whole thing, you'll need to edit it in the template directly until Universal gets implemented.
     
    assemblergames likes this.
  15. Lone Wolf

    Lone Wolf Well-Known Member

    I've been trying to upgrade my Google Analytics account to Universal Analytics. According to the literature I'm supposed to login as Admin and go to the Property field and select the option there. But I cant see any option to upgrade to Universal.
     
  16. Silivistras

    Silivistras Member

    I don't understand where i have to put the code that google gives for universal analytics. The ID seems easy to put ...

    [​IMG]

    .... but the code?
     
  17. Silivistras

    Silivistras Member

    Ok, i read more carefully and i saw that the code goes to google_analytics template. Do i have to repeat the procedure of replacing code for every style i use at forum?
    The path is Appearance > Styles > xxxx(style) > Templates> google_analytics > Edit Template: google_analytics

    Do i have to replace all this ...

    [​IMG]


    .... with the Google code?
     
    Last edited: Dec 22, 2015
    DeMelo likes this.

Share This Page