Created
November 6, 2009 16:48
-
-
Save ttrefren/228091 to your computer and use it in GitHub Desktop.
This file contains hidden or 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> | |
| <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></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> | |
| <script type="text/javascript"> | |
| try { | |
| var mpmetrics = new MixpanelLib("YOUR TOKEN"); | |
| } catch(err) { | |
| null_fn = function () {}; | |
| var mpmetrics = { track: null_fn, track_funnel: null_fn, register: null_fn, register_once: null_fn }; | |
| } | |
| // jquery onload event | |
| $(function(){ | |
| console.log("view"); | |
| mpmetrics.track('View'); | |
| }); | |
| </script> | |
| </head> | |
| <body>hi</body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment