2 google analytics UA codes

Discussion in 'Google Analytics' started by anshulking, Sep 23, 2012.

  1. #1
    hi,

    I have to test a template for my site, not for a page but for entire site, so i am inserting another code for the new template in my GA code.

    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-XXXXXX-1']);
    _gaq.push(['_setDomainName', 'none']);
    _gaq.push(['_setAllowLinker', true]);
    _gaq.push(['_trackPageview']);
    _gaq.push(['_trackPageLoadTime']);


    _gaq.push(['new._setAccount', 'UA-XXXXXX-2']);
    _gaq.push(['new._setDomainName', 'none']);
    _gaq.push(['new._setAllowLinker', true]);
    _gaq.push(['new._trackPageview']);
    _gaq.push(['new._trackPageLoadTime'])

    So UA-1 shall track the total numbers for the entire site together in the main profile and UA-2 will only be there for the new template in a new profile.

    Anyone can suggest me on this.
     
    anshulking, Sep 23, 2012 IP
  2. zingzing

    zingzing Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Many people have reported malfunctions when having two GA codes on the same website/pages. I haven't persoanlly tried it, but it's something you may want to consider
     
    zingzing, Oct 6, 2012 IP