Skip to content

Instantly share code, notes, and snippets.

@Suhail
Created October 31, 2009 05:14
Show Gist options
  • Save Suhail/222920 to your computer and use it in GitHub Desktop.
Save Suhail/222920 to your computer and use it in GitHub Desktop.
<!-- First include the script: -->
<script type="text/javascript">
var mp_protocol = (("https:" == document.location.protocol) ? "https://" : "http://");
document.write(unescape("%3Cscript src='" + mp_protocol + "api.mixpanel.com/site_media/js/api/mixpanel.js'
type='text/javascript'%3E%3C/script%3E"));
</script>
<!-- Initialize it with your project token -->
<script type="text/javascript">
try { var mpmetrics = MixpanelLib("YOUR_TOKEN");} catch(err) {}
</script>
<!-- Then make calls to our API as shown below: -->
<script type="text/javascript">
mpmetrics.track('click-menu', {'gender':'male', 'button':'about'});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment