gaAddons - Google Analytics Addons by Stéphane Hamel
Automated cross-domain tracking.
You might want to review the Test Cases for additional examples.
Refer to Google Analytics article about cross-domain tracking for additional information..
This call must come before your regular _trackPageView. In fact, the best practice would be to put _setXDomain just after your _setAccount call
When tracking multiple domains in a single profile, pages with identical URLs will be rolled up into one. In the example below, www.example-petstore.com/index.htm and dogs.example-petstore.com/index.htm will be considered one and the same in your Google Analytics reports. You should set up an advanced filter in your Google Analytics profile so the resulting, tracked URLs also includes the full domain name. Refer to the article on the ROI Revolution blog for step by step instructions about Tracking Multiple Domains.

_gaq.push(['_setXDomain', {
domainName: 'example-petstore.com'
}]);
Here, we tell _setXDomain that any subdomain of .example-petstore.com should be tracked, thus, www and dogs._gaq.push(['_setXDomain', {
domainName: 'example-petstore.com',
include: /(my-example-blogsite.com|otherdomain.com)/
}]);
We tell gaAddons the main domain is exampler-petstore.com but we also want to track my-example-blogsite and otherdomain in the same account._gaq.push(['_setXDomain', {
domainName: 'example-petstore.com',
include: /(blog-hosting-service.com\/myBlog|otherdomain.com\/otherdir)/
}]);
This is the same concept as above, but only for a specific directory of the other domain._gaq.push(['_setXDomain', {
include: '/myBlog/
}]);
If what you have access to is only a sub-directory of the current domain. Note, again that domainName is a regular expression, giving you more control over what needs to be tracked.