Suppose I have the website www.example.com and www.example2.com. I redirect all page requests from www.example2.com to their corresponding pages at www.example.com. Is there a way for Google Analytics to track visits at www.example2.com?

I read http://www.google.com/support/analytics/bin/answer.py?answer=55503 and suggested to add tracking code to the links on my second domain (www.example2.com). However, I don't have pages in my second domain as it always redirects to the other one.

Is it possible to track multiple domains this way?

  • If they are never on example2.com because of the redirect, how can you track them if they can ever use the example2.com website at all since it really doesn't exist?
    – John Conde
    May 2, 2011 at 3:21
  • Precisely. Thinking of putting GA code in one page then do redirects using javascript. What could be the negative implications?
    – Dave
    May 2, 2011 at 3:39
  • 1
    Doing redirects with JavaSCript is a bad idea. If someone doesn't use JavaScript, like search engines, they don't get the redirect. Then you have duplicate content issues and can confuse your users. Use a server side 301 redirect. That's the infallible way for this to be done.
    – John Conde
    May 2, 2011 at 11:40

2 Answers 2


You could treat your redirecting domain as a campaign and append campaign variables to the redirected URL.

For example:


... could redirect to:


(i.e. your redirect would always append the ?utm_source=example2.com&utm_medium=Redirect&utm_campaign=Redirects query to instruct Google Analytics to track the hit as a campaign link; the downside to this method is that, should the visitor share the link with the appended query string, other hits which are not necessarily redirects would appear under the Redirects campaign)


There is a setting when adding your GA code to allow for multiple domains.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.