Usage logging on client side

Hi,

I am working on a usage logging mechanism (similar to piwik or google analytics) that collects usage logging data such as client information and user activities, then pack them to a JSON object before send it to the server asynchronously then persists to the DB.
I wonder if my design is valid, and if anyone already did something similar that could point me to some examples. Thank you very much!