Ruby gem to track search engines redirection traffic (search keyworks)

236 Views Asked by At

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?

1

There are 1 best solutions below

0
On BEST ANSWER

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.