We encountered this problem about six months ago and decided to create an open source javascript library that will abstract the Mixpanel functionality in all analytics services that we use, including KISSmetrics, Google Analytics, Chartbeat, etc.
You can check it out at http://segmentio.github.com/analytics.js
The result is a simple API where you can call analytics.track () or analytics.identify () in one line of code and send data to all the different providers.
The library also has helper functions such as analytics.trackLink () and analytics.trackForm () to make it easier to track outbound clicks and form submissions, which usually results in a page reload before events can be sent. These functions introduce slight delays for events to exit.
source share