Getting Basic Info: 1) 1x1 pixel method which request a 1 pixel image from your server which will pass the requesting client's info. A lot of people use this method because it's fairly simple and cross browser. 2) (I assume) guys like sharethis/addthis etc, request a javascript on your server which would pass all the client's information to the server per that request Tracking things like mouse movement, page area etc would most likely require a more customize javascript that will send data to server via ajax/page unload etc.
Storing Data: Because the data you will be collecting for analytic is HUGE. Think much bigger than HUGE. You'll need a real big-boy set up like a Distributed Storage/Database system. Most of the big guys use their own. Here is where you will need to read up on key/value databases like Cassandra or Hadoop etc.
Anyone with much more experiences and wiser thoughts, please do share and correct me as I am still learning about this. Good luck and thank you.