Google Analytics - Subdmains?

Discussion in 'Google Analytics' started by Professional Dude, Jul 26, 2009.

  1. #1
    If I put my analytics code in all parts of my sites, including subdomains, will they be counted and shown in stats?

    Currently, analytics only show domain.com/ stats but not the subdomain/

    Does this mean I have to add new site for each subdomain?
     
    Professional Dude, Jul 26, 2009 IP
  2. stephen082

    stephen082 Active Member

    Messages:
    843
    Likes Received:
    81
    Best Answers:
    0
    Trophy Points:
    95
    #2
    You can track subdomains within the same profile as the domain. In order to do so, you'll need to add a line to the tracking code on each page of your site. If you have already put google analytics code in your domain you need to add following line in your code (written in bold) to all pages in subdomain as well as domain.

    <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
    </script>
    <script type="text/javascript">
    _uacct = "UA-xxxx-x";
    _udn=".example.com";
    urchinTracker();
    </script>

    You can know more about it from here:

    http://www.google.com/support/googleanalytics/bin/answer.py?answer=74981

    and for latest version of analytics code read this:

    http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55524

    Hope it will help :D

    Edit: Here is another detailed tutorial that can help you http://theanalyticsguru.wordpress.com/2008/03/01/tracking-subdomains-within-google-analytics/
     
    stephen082, Jul 27, 2009 IP