Ask HN: Analytics: Hosted or Custom for my publishing platform

I want to add analytics to my application (I basically host Facebook Pages for users), so users can see how many users viewed and or clicked on their links.

All I really want to do is log views and clicks and display this to my users in their publishing dashboard. I can't decide if I should write something like this from scratch, or if I should use a service like Mixpanel to do it for me.

What would you recommend and what would the pros and cons of either solution be?

  • Has anyone used something like this: http://piwik.org/docs/javascript-tracking/

  • Piwik is pretty great, nice for being free. You can definitely install that and write up a script to attach to their api, it's pretty easy to use.

    Please please please host your analytics on a completely different server though. Analytics is a heavy duty operation, and should be no where near your app code.

    Don't write it yourself, piwik has done all of the heavy lifting for you, don't reinvent the wheel at this stage.