Long-time readers of this blog know I’m absolutely goo-goo for CrazyEgg, principally because they keep making me money. They’re seriously my favorite $19 to pay every month, even when I don’t actually use them, because some day I know I’ll get the itch again and then bam actionable insights into what my customers are doing. Today is an itchy day.
CrazyEgg’s current user-agent string is:
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:18.104.22.168) Gecko/20091016 (CrazyEgg 2 screenshot agent) Firefox/3.5.4
Then just shortcircuit your login procedure for people with that user agent. (This may be undesirable if you are very, very security conscious. I sell bingo cards to 60 year old women. If you are security conscious, email them and they’ll provide a listing of IPs to whitelist.)
In Rails, doing something on the basis of the user agent is easy but, and I know this might come as a surprise, not covered in the documentation.
For a quick 30 second solution, I signed up as a trial user for my own service with the email address email@example.com, and have the analogue to the above method on my site just pretend that anybody with the appropriate User Agent is authenticated as that user.