1
votes

How can I have Google Analytics recognize when one of my domain aliases is being used? It seems that Analytics metrics are only being captured when the visitor uses the site's original domain: mysite.com.

I have 5 domain aliases that all point to example.com/index.html. I do this redirect by the following htaccess code:

rewritecond %{HTTP_HOST} ^(www\.)?alias1\.info$ [NC]
RewriteRule ^$ /index.html?north [R=301,QSA,L]

The site and the five domain aliases are all hosted in the same location. These are not sub domains.

1
Are you trying to get GA to track multiple domains? There's some documentation for that. - Jon Lin
Yes, but my situation is unique and not mentioned in that documentation. I am not trying to capture data on a different site's traffic; I am trying to capture traffic data when my site's domain aliases are used. - John Montague
Do you have any filters in place on the view in GA that would limit it to a single domain? - MisterPhilip

1 Answers

1
votes

You should put your base URL in this part of the code: _gaq.push(['_setDomainName', 'alias-of-domain.com']);. You should recognize the base URL for each alias and change this part of the code for each of the aliases. After that, you need to create a new view for each of the aliases in the Analytics and apply a filter to each one of them.

Check Google documentation, everything is explained here: Tracking Multiple Domains - Web Tracking (ga.js).

If you are using Universal Analytics, then check this page.