Tracking Subdomains in One Profile for Google Analytics
In order to track subdomains within the same profile as the primary domain, you will need to add an extra line in every pages with the tracking code.
Assuming your primary domain is “.your-site.com”
Following is the line you will need to add:
pageTracker._setDomainName(“.your-site.com”);
For example, it will look like this…
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-xxxxxx-x");
pageTracker._setDomainName(".your-site.com");
pageTracker._initData();
pageTracker._trackPageview();
</script>
As a result, Google Analytics will throw the following results for each of these URLs.
- www.your-site.com/default.html –> /default.html
- shop.your-site.com/info.html –> /info.html
If you want to distinguish between your subdomains, you’ll need to create an “Advanced Filter” for your profile.
Filter Type: Custom filter > Advanced
Field A: Hostname
Extract A: (.*)
Field B: Request URI
Extract B: (.*)
Output To: Request URI
Constructor: /$A1$B1
Now, the results for the above examples will look like:
- www.your-site.com/default.html –> www.your-site.com/default.html
- shop.your-site.com/info.html –> shop.your-site.com/info.html
Related Articles:
Google Analytics – Linking Across Different Domains
Analytics Tracking and Reporting Online and Offline Campaigns
Overview of Implementing Google Analytics Tracking Codes
Search
Info | Connect
Ads
Email Sign Up
Recent Posts
- 5 Tips to Building Great Web Analytics Vendor Relationship
- Mobile Analytics is Very Unique and Different from Website Analytics
- Getting Ready for Mobile Site or Apps Analytics
- Digital Data in Marketing Mix Modeling
- Usability Analysis to Improve User Experience
- Google Analytics Multi Conversion Funnel Report
- Focus on insights – Rapid BI deployment of analytics reports
- Integrating Web Analytics Data with Social Profile Data
- Role of Web Analytics Analysts and Expectations
- Measuring and Reporting Paid Owned Earned Media
Tags
Action Analysis analytics Bounce Content conversion goal Google Google Analytics Improve Increase Keywords KPI Landing measure metrics New Opportunities optimization Optimize outcome Page Qualified Visitors Rate reporting satisfaction Search Segment Segmentation Segmentations SEM SEO Site Social Media strategies tagging Terms Tracking Traffic Understand Value visitors Visits Web web analytics
