1

My company utilizes numerous domains and TLDs that all end up pointing to one main domain. The domains include variations of the company name or its product items. For instance,domain.cc, domain.biz, domain.info, do-main.cc, do-main.biz, do-main.info, etc.

As the webmaster, I am tasked with tracking these domains and their usage to determine which are effective and which are not. At some point then I will have to determine which domains to let expire and which to renew.

How do I do this? I've looked at Google Analytics and it doesn't show me this data anywhere. I've looked at the server raw logs (Apache) and this too leaves off the requested TLD in the incoming URL. It was suggested to add a UTM parameter to my redirects in htaccess, but I'm not sure how that would be implemented. Suggestions? And thanks!

1

Redirecting with UTM parameters is a good way of doing it. See Can I track referral traffic in Google Analytics from a domain that is redirecting to my site?.

Here is a rewrite rule that should do the redirection and add the needed UTM parameters:

RewriteCond "%{HTTP_HOST}"   "example\.cc$" [NC,OR]
RewriteCond "%{HTTP_HOST}"   "example\.biz$" [NC,OR]
RewriteCond "%{HTTP_HOST}"   "do-main\.example\.com$" [NC]
RewriteRule "^/?(.*)"        "http://www.example.com/$1?utm_campaign=domainnames&utm_medium=domain&utm_source=%{HTTP_HOST}" [L,R=301,QSA]

If you are on IIS, we had somebody ask about how to implement it there: Track Google Analytics from a redirected domain using IIS

If you want to have Apache log them you can do so as well. I recommend turning on logging of the host name in Apache logs. I use the following log directives to append it to the end of the log file:

# Log format: combined logs with virtual host
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %v" combinedserver
CustomLog /var/log/apache2/access_log combinedserver
  • The htaccess UTM params was a good idea. I will implement that and give it a try. Thanks for the quick response. – Blisteragent Jan 6 '17 at 21:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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