0

Most of the traffic from my site is sent by search engines. I am trying to track the keywords used on the search (EG to have real-time stats on the 'hottest' searches).

What are my options? I thought of:

  1. Parsing the HTTP_REFERER (using a list regexps for major search engines)

  2. Importing google analytics data (using google analytics api) - however this is not realtime

Are there any gems/libraries that offer support for this?

Vlad Zloteanu
  • 8,464
  • 3
  • 41
  • 58

1 Answers1

1

I would write a middleware for rack to do this. http://www.hokstad.com/slidingstats is an example of one that tracks referrers. It is pretty easy to hack and not complicated so you can probably use this as a launchpad for what you want to do.

Michael Papile
  • 6,836
  • 30
  • 30