Mobile app version of vmapp.org
Login or Join
Carla537

: How to track usage of redirecting domains using either Google Analytics or server logs using Apache My company utilizes numerous domains and TLDs that all end up pointing to one main domain.

@Carla537

Posted in: #Analytics #Domains #Google #Htaccess #TopLevelDomains

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!

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Carla537

1 Comments

Sorted by latest first Latest Oldest Best

 

@Megan663

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/?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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme