The ROI Revolution Blog

« $6,000/month on Google AdWords w/o Google Analytics? | Main | Yahoo's Panama Project Revealed! »

Tracking Multiple Domains

September 26, 2006

Justin Cutroni has yet another great series of articles over at his blog, all about common Google Analytics configuration mistakes. His most recent post discusses third party domains, and getting Google Analytics to track across them. As usual, it's well-written and very informative.

One thing that many people don't know, however, is that, by default, Google Analytics will track only the request URI of its tagged pages.

What's the URI, you ask? Take a look at the URL below:

Hostname and URI explained

You see that the part of the URL that is surrounded by red is "/index.htm". So, when a visitor hits the page above, Google Analytics registers a unique visit to "/index.htm". Because the majority of Google Analytics profiles are focused on only one domain, the hostname (surrounded by blue) is ignored in the reports.

But what if you have two domains? And what if you have pages on both domains that have the very same URI?

We work with a client who wants to track visits across two of their domains. www.smithmountainhomes.com and www.smithmountainlakenews.com. Both of these domains have a default page called "index.htm". So, once tagged with the special Google Analytics JavaScript snippet required for cross-domain tracking, these two pages would begin to register views for the URI "/index.htm":

URI aggregation in Google Analytics
(Click the image above to view a larger version.)

These unique views would show up in Google Analytics aggregated into a single entry:

Index.htm as a single entry.

This is misleading data. We don't know which of those 371 unique views are attributed to each individual domain being tracked.

Fortunately, you can use an Advanced Filter to grab the hostname and insert it into your results:

Field A: Hostname -> Extract A: (.*)
Field B: Request URI -> Extract B: (.*)
Output To: Request URI -> Constructor: $A1$B1

Now both the URI and the hostname are being collected in your reports:

URI and hostname tracking

And you will be able to differentiate between the two pages very easily from within Google Analytics:

Report with both hostname and URI displayed

Need help tracking multiple domains in a single Google Analytics profile? Hire us to help you today.

Interested in learning more about Google Analytics?
Attend our LIVE Google Analytics Seminars for Success training in Chicago, IL Wednesday, September 16th, 2009 and Thursday, September 17th, 2009 or get the latest tips and tricks sent to you via our free, twice-monthly Google Analytics newsletter.

TrackBack

TrackBack URL for this entry:
/mt/mt-tb.cgi/168.

Comments

We used the above advanced filter for tracking unique urls on a profile for an account to see how well it would work. We had the original profile and a 2nd profile for this website. We put the advanced filter on the 2nd profile. The problem we encountered was that the original profile also seemed to be effected by the filter and the goals we had set up on the original profile were not being tracked correctly even though they had the complete page urls in the goal funnel. Should a filter you apply to a 2nd profile effect the original profile?

Thanks,
Cory

Posted by: Cory at October 4, 2007 2:34 PM

@Cory: A filter applied to one profile should never affect data on another, and I've never seen any situations where it has.

Posted by: Michael Harrison at October 11, 2007 3:57 PM

I am having problem while setting funnels. I have multipe entry like
Step 1 :
a)index.html
b)index2.html
c)index3.html

Step 2 : registeration.html and
Step 3 : logout.html

how to set funnels at the step 1, I mean how to set the 3 index pages at one step of funnel settings.

Posted by: intelli at August 11, 2008 10:03 AM

@intelli: In this case, you can use regular expression goals to set step 1 to all three of your pages. Check out the official help section on regular expressions here: http://www.google.com/support/analytics/bin/answer.py?hl=en&answer=55582

Posted by: Michael Harrison, Google Analytics Support Tech Author Profile Page at August 12, 2008 10:29 AM

where to appl advance filter in main site profile or subdomain profile?

Posted by: Anu Singh at September 8, 2008 8:39 AM

@Anu: Apply it to the main site profile. You'll know that the subdomain/domain-only profile contains only pageviews from the appropriate domain or subdomain, so there's no need for the filter.

Posted by: Michael Harrison, Google Analytics Support Tech Author Profile Page at September 8, 2008 3:26 PM

Hi, Great tip here. However, once implemented, the content distinguishes between the pages "www.mydomain.com" and "mydomain.com". How would you cause the report to treat the pages above as 1 page?

Posted by: Paul at September 11, 2008 12:05 PM

@Paul: One trick is to write a filter that, instead of adding the domain to the Request URI, just adds a short and easy-to-read word. It turns:

www.maindomain.com/page.html -> /main/page.html
www.shoppingdomain.com/page.html -> /shop/page.html

This consolidates them together and makes them easier to read in the Top Content report.

We cover this filter, as well as a number of other customizations, in our Google Analytics Implementation Training, which is given online and in person.

Posted by: Michael Harrison, Google Analytics Support Tech Author Profile Page at September 12, 2008 9:43 AM

I moved from the old ga code to the new tracking code and since then my cross domain tracking is not functioning. All inbound from the other site is showing as areferral. Can you see what I may have done incorrectly?

an example page:
http://www.mysterypartygames.com/Other_Mystery_Themes.html

here's my data:
from site A (outbound)


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"));


var pageTracker = _gat._getTracker("UA-29141x-1");
pageTracker._setDomainName("none");
pageTracker._setAllowLinker(true);
pageTracker._trackPageview();

link is:

from site B - inbound:


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"));



var pageTracker = _gat._getTracker("UA-29141x-1");
pageTracker._setDomainName("none");
pageTracker._setAllowLinker(true);
pageTracker._trackPageview();


Posted by: Lou Anne at October 5, 2008 2:25 PM

@Lou Anne: Be sure that you are following every item listed under the Google Analytics help article on multi-domain tracking, especially item #3. If you're not using the _link method to pass the data from one domain to the other, it won't work.

Posted by: Michael Harrison, Google Analytics Support Tech Author Profile Page at October 6, 2008 11:00 AM

Hi

I was just wondering if there is any way of posting data on google analytics without using javascripts. Any advice would be greatly appreciated.

Thanks a lot for your time.

Posted by: Padma at January 13, 2009 3:22 PM

@Padma: Google Analytics is entirely dependent on JavaScript, so there is no way to post data to it without using JS.

Posted by: Michael Harrison, Google Analytics Support Tech Author Profile Page at January 29, 2009 1:55 PM

This filter is what I was looking for, however, applying it *seems* to break the navigation summary reports. Is that possible?

For example, looking at the navigation summary of the page www.domain1.com/product shows www.domain1.com/product/buy as the next page for some % of visits, but that's it. It stops there instead of showing www.checkout.com/step1 as the next page for at least some of the visits (just looking at the content overview shows that this page was indeed visited, and the referrer was domain1.com).

I'll be grateful if you can point me in the right direction.

Juvaly

Posted by: Juvaly at March 13, 2009 12:14 PM

Post Your Comments

Feedback Form