Created
July 7, 2011 02:43
-
-
Save carlsverre/1068802 to your computer and use it in GitHub Desktop.
Multiple mixpanel instances on the same page using the Async library
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Your page</title> | |
</head> | |
<body> | |
<div>Your content</div> | |
<script type="text/javascript"> | |
var mpq=[];mpq.push(["init","0725059687a1080dffb343076224e1b1"]);(function(){var a=document.createElement("script");a.type="text/javascript";a.async=true;a.src=(document.location.protocol==="https:"?"https:":"http:")+"//api.mixpanel.com/site_media/js/api/mixpanel.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)})(); | |
mpq.push(function() { | |
window.mpq2 = new MixpanelLib("7efd61a5d7fb7b37549f15e9cb0fcb22", "mpq2"); | |
// at this point (and after this function has been called), window.mpq2 is an instance of the full mixpanel library | |
// so you would do window.mpq2.track("Event") rather than window.mpq2.push(["track", "event"]) | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment