Fork or plugin idea
If you are an Erlang programmer (or you're looking for a new project to learn Erlang), then you definitely can write anything you want as a plugin/extension to CouchDB. The smallest example I know of is Die CouchDB, my proof-of-concept which adds one query that will simply stop the server.
https://github.com/iriscouch/die_couchdb
You could in principle write a plugin or fork of CouchDB to handle GET requests and do anything with them.
Note about REST architecture
I am not super familiar with analytics implementations, but the point of REST and HTTP is that GET
queries have no side-effects and/or are idempotent (running 50 queries is no different from running one).
The upshot is, proxies can and will cache many GET responses, in both standard and nonstandard ways. That seems incompatible with user tracking and data gathering techniques; however maybe analytics tools still think the benefits outweigh the costs.
For most people, it's probably easier to use external tools.
Log idea
One trick is to GET anything from Couch, and then check the log entry from couch. You can get the couch log by querying /_log
as the admin. The log will show users' IP address, request path, and any query parameters.
For example
$ curl -X GET http://localhost:5984/?userid=abcde\&windowsize=1024x768\&color=blue
{"couchdb":"Welcome","version":"1.1.0"}
$ curl localhost:5984/_log | grep userid
[Mon, 23 May 2011 00:34:54 GMT] [info] [<0.1409.0>] 127.0.0.1 - - 'GET' /?userid=abcde&windowsize=1024x768&color=blue 200
Next you can process that log entry and re-insert into your actual analytics database yourself.
Wrapper idea
A final solution is to run a simple reverse-proxy which converts your GET requests into whatever you need. NodeJS is getting popular for tasks like that, but you can use any web platform you prefer: PHP, ASP, JSP, whatever you know already.
You simply respond to the GET request and do whatever you need on the server side, such as inserting the relavant information into your analytics db.
Good luck!