Skip to content

Instantly share code, notes, and snippets.

@Suhail
Created October 31, 2009 05:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Suhail/222937 to your computer and use it in GitHub Desktop.
Save Suhail/222937 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