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

Multiple Google Analytics Codes?

Discussion in 'XenForo Questions and Support' started by taylor_smith, Aug 13, 2012.

  1. taylor_smith

    taylor_smith Well-Known Member

    Is there a way to add additional Google Analytics codes without editing the google_analytics template for every single style?
     
  2. DBA

    DBA Well-Known Member

    What do you mean by "additional Google Analytics codes"?
     
  3. CyclingTribe

    CyclingTribe Well-Known Member

    Use one code in your XF board options then add filters (within GA) for the pages/sections you want to analyse; unless you're trying to achieve something directly related to different skins?
     
  4. taylor_smith

    taylor_smith Well-Known Member

    Already have a property code for the domain, but also have a separate property for forums. Want to have a property for both, but add a profile for forums to the primary domain property.
     
  5. CyclingTribe

    CyclingTribe Well-Known Member

    Okay, go to Admin and select the primary domain property.

    Click the New Profile button.

    Name your profile, e.g.; forums

    The new profile should now be selected so click the Profile Settings tab and add "/forums" to the Website's URL field and click Apply at the bottom.

    Is that what you're after?

    Cheers,
    Shaun :D
     
  6. taylor_smith

    taylor_smith Well-Known Member

    Heh, I mean actually placing the second code into our forums. I've got the profile added, but the property code for it hasn't been added.
     
  7. CyclingTribe

    CyclingTribe Well-Known Member

    Okay, I'm a bit confused - you've two Property ID's? One for the main site (domain) and one for the forums (which you add to XF via Home > Options > Statistics and Metrics) - why the need for the separate forums profile on the main property ID?

    In this scenario there also shouldn't be any need to modify templates - you just put the forums propery ID into XF.

    Apologies if I've misunderstood what you're trying to achieve.

    Cheers,
    Shaun :D
     
  8. DBA

    DBA Well-Known Member

  9. taylor_smith

    taylor_smith Well-Known Member

    Because the original forum property ID has 7 years of data that will be lost if I junk it and start a new one.

    I know how to add a property id, assign a profile and filters. :) I'd like to add a second code, though, to track my network as a while with one, but maintain the existing years of data with the other.

    I've done this with multiple WordPress sites. You add the this way:

    Code:
    _gaq.push(['b._setAccount', 'UA-3196911-27']);
    _gaq.push(['b._trackPageview']);
     
    _gaq.push(['c._setAccount', 'UA-3196911-40']);
    _gaq.push(['c._trackPageview']);
    Just looking for a way to do it in XenForo without adding it to every individual theme.
     
  10. DBA

    DBA Well-Known Member

    Why would you have to junk it and start a new one?
    Interesting, did not know that you could have multiple ID's/accounts on the same page.

    While not recommended, you could add it to the Master Style, just make sure to back it up before upgrading XF in the future (as it'll be overwritten).
     
    taylor_smith likes this.
  11. taylor_smith

    taylor_smith Well-Known Member

    Good insight. I'll give it a shot. :)
     

Share This Page