55°F

Aaron Parecki

  • Articles
  • Notes
  • Photos
  • Tracking typos of your domain name in Google Analytics

    December 9, 2010

    Say you want to register a couple different typos of your domain name, and redirect everyone seamlessly to the correct site. This can be done quite easily in Apache using ServerAlias and a simple RewriteRule. I just registered geoloqui.com after noticing a couple articles linking to it instead of geoloqi.com. But then I thought, wouldn’t it be useful if I could track these typos and see which ones are most common? Turns out it’s not difficult!

    Here is a snippet of my virtual hosts definition for geoloqi.com:

    <VirtualHost *:80>
      ServerName geoloqi.com
      ServerAlias *.geoloqi.com
      ServerAlias geoloqui.com
      ServerAlias *.geoloqui.com
    
      RewriteEngine on
      RewriteCond %{HTTP_HOST} !^geoloqi.com
      RewriteRule ^/(.*)$ http://geoloqi.com/$1?utm_source=DomainRedirect&utm_medium=%{HTTP_HOST} [R=permanent,L]
      ...
    

    This will make domain typos visible in Google Analytics under the "All Traffic Sources" section. You can clearly see the referrals from the typo'd domain name at the bottom of this list.

    |center

    You could also use the filter box to search for "DomainRedirect" and see only the typos.

    I'd be curious to know if anybody else has other suggestions for tracking this type of thing.

    Thu, Dec 9, 2010 12:23am -07:00 #hacks
Posted in /articles

Hi, I'm Aaron Parecki, Director of Identity Standards at Okta, and co-founder of IndieWebCamp. I maintain oauth.net, write and consult about OAuth, and participate in the OAuth Working Group at the IETF. I also help people learn about video production and livestreaming. (detailed bio)

I've been tracking my location since 2008 and I wrote 100 songs in 100 days. I've spoken at conferences around the world about owning your data, OAuth, quantified self, and explained why R is a vowel. Read more.

  • Director of Identity Standards at Okta
  • IndieWebCamp Founder
  • OAuth WG Editor
  • OpenID Board Member

  • 🎥 YouTube Tutorials and Reviews
  • 🏠 We're building a triplex!
  • ⭐️ Life Stack
  • ⚙️ Home Automation
  • All
  • Articles
  • Bookmarks
  • Notes
  • Photos
  • Replies
  • Reviews
  • Trips
  • Videos
  • Contact
© 1999-2025 by Aaron Parecki. Powered by p3k. This site supports Webmention.
Except where otherwise noted, text content on this site is licensed under a Creative Commons Attribution 3.0 License.
IndieWebCamp Microformats Webmention W3C HTML5 Creative Commons
WeChat ID
aaronpk_tv