I am currently building a site where it would be nice to show some timeline statistics (most viewed pages in last 24h/7d/30d/rising). For tracking, I use Google Analytics, however, as far as I know, they do not provide an API. There is a way by mailing the analytics report as XML to a google group and grabbing this data with yahoo pipes and then you can get it back into the site using Javascript.... but that is not really an option for me. As for this site, I'd like to reduce the javascript generated content (can Yahoo Pipes deliver XML via REST

To add a little spice to the soup: The pages that are going to be tracked are mostly based on a single CMS Content Page, the rest is dynamic output generated by the page. The parameters are URL rewritten to imitate a file structure and to make it prettier.
e.g.
[HOME] >> [DYNAMIC PAGE] >> [PARAMETER1-PARAMETER2]
As such, I'd like to pass a specified ID (varchar) to the module, to make sure, the counter is increased for the "virtual" pages instead of just the areas root page ("dynamic page").
Preferably, I'd like to provide a parameter that is derived from the two parameters and calculated on the dynamic page itself. As such, using the request uri would be a second choice for me.
There are three modules I could identify:
1) Hitcounter
Very simple but actually as simple as I want it to be. However needs changes in terms of being able to receive an ID. Also isn't able to take care of the timeline issue.
2) Statistics
Quite comprehensive statistics... however, as far as I understood, it only works per page-id. I can not specify a specific ID for a call - so I can not capture parameterized pages. But I think it is capable of the timeline issue.
3) Visitorstats
Not sure about that one. Seems very simple... haven't played with it that much. But after looking at the table structure it doesn't look like what I'm after as well.
So my question is, how would you approach the issue? How can i pass an own ID to any of the statistics modules? Or is writing an own module the way to go?
I could still go for that yahoo piped/google groups/xml report mailing construction... but then... it sounds like so much work

I already though about going through the comments DB table and create more of an activity overview by extracting the comment-dates. The obstacle I see here, is that only pages that engage user interaction will be on the front (which isn't that bad after all - now as I think of it - I think it's wort a plug-in to write

I'm glad for any input.
Best
Nils