title: Using mixpanel to build custom analytics dashboard for users
body: <p><em>I love graphs</em>. </p>
  
  <p>I'd love to get my hands on some data and make it look pretty. But alas, I'm a little lost on what would be considered best practice.</p>
  
  <p>I've selected mixpanel (only as an example) as I seems wonderfully easy to track custom events, and doesn't have any subdomain limitation like Google Analytics.</p>
  
  <p>Say I had 100-1000+ users who have an account (which is publicly facing), and I'm currently tracking the public interactions their pages get. With mixpanel, I can see the data which is lovely, and I've segmented it to individual accounts. So far, so good!</p>
  
  <p>But then, I want to show my users this information. And here my head begins to hurt. Do I schedule a cron jobs, pulling in the data from mixpanel and writing it to their respective accounts? Or is there a better way? I've looked into mixpanel's api (I'm using Ruby), but they keep telling me I should use the javascript api. But in using JS, how does one prevent others getting the data  (ie. what's stopping someone faking mixpanel api-posts in the console, or viewing my private key?).</p>
  
  <p>What would you consider a practical solution in such a case? </p>