Using Google Analytics with my REST API


My site provides public JSON API. I want to track usage of this API (like I do for webpages) with google analytics. How can I track API usage?

Maybe you could look at something like this or this? Depending on your implementation, of course.