Loading ...
Sorry, an error occurred while loading the content.

21540How do I get cross subdomain visits treated as a single visit in GA?

Expand Messages
  • tom_collier2002
    Mar 1, 2009
    • 0 Attachment
      I have multiple subdomains all being tracked on a single domain in
      Google Analytics, each using the same tracking code. Assume the sites
      are:

      * mysite.com
      * blog.mysite.com
      * cart.mysite.com

      With tracking code:

      <script type="text/javascript">
      var gaJsHost = (("https:" == document.location.protocol) ?
      "https://ssl." : "http://www.");
      document.write(unescape("%3Cscript src='" + gaJsHost +
      "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
      </script>
      <script type="text/javascript">
      var pageTracker = _gat._getTracker("UA-#######-3");
      pageTracker._initData();
      pageTracker._setDomainName(".mysite.com");
      pageTracker._trackPageview();
      pageTracker._setAllowHash(false);
      </script>

      What I expected was that if a visitor clicks on one of my subdomains
      to a different one, that would be tracked as 2 pageviews in a single
      visit. For example, assume a visitor takes the following path on my
      sites:

      1. enters at http://blog.mysite.com/Big_Sale_on_Widgets
      2. clicks a link from the blog post through to
      http://mysite.com/products/Widgets
      3. clicks the buy now button on the widgets page to
      https://cart.mysite.com/CheckOut
      4. submits purchase form and is redirected to
      https://cart.mysite.com/ThankYou

      As far as I'm concerned, this is one path in one visit and should be
      reported as such. However, when I look at navigation summaries for
      different pages I don't see any path with multiple subdomains (e.g.
      all previous/next pages to cart.mysite.com/CheckOut are entrances or
      pages on cart.mysite.com). Along the same lines, in the referring
      sites report each subdomain is listed as a referrer to the other two
      (e.g. mysite.com is a referrer to cart.mysite.com).

      What do I need to change to get my desired behavior?
    • Show all 3 messages in this topic