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
function invite_friends() { | |
... | |
mpmetrics.track('invite friends', { 'num_friends': friends.length, 'id': user_id }); | |
... | |
mpmetrics.track_funnel('intro skip', 2, 'invite', { 'from': source }); | |
} |
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
// Track a page load. Very simple. | |
mpmetrics.track("Page load"); | |
// Track a user that plays a game. We include the genre and game title. | |
mpmetrics.track('Play game', {'genre': 'action', 'title': 'Tomb Raider'}); | |
// Track the first step of a signup funnel. | |
mpmetrics.track_funnel("Signup", 1, "Hit landing page", {'from': 'google'}); | |
// Register some properties to include with all events sent, so you don't have |
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
// import the library - this will change based on where you put it | |
import MixpanelLib; | |
// initialize with your project token | |
internal var mpmetrics:MixpanelLib = new MixpanelLib("YOUR TOKEN"); | |
// track events with ease | |
private function sendPhoto():void { | |
// Do stuff | |
mpmetrics.track("Sent photo", {'type': 'png'}); |
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
<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> |
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
<a href="http://mixpanel.com"> | |
<img src="http://mixpanel.com/site_media/images/mixpanel_partner_logo.gif" | |
alt="Analytics by Mixpanel" /> | |
</a> |
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
if(!UserVoice){var UserVoice={};} | |
if(!UserVoice.Util){UserVoice.Util={sslAssetHost:"https://uservoice.com",assetHost:"http://cdn.uservoice.com",getAssetHost:function(){return("https:"==document.location.protocol)?this.sslAssetHost:this.assetHost;},render:function(template,params){return template.replace(/\#{([^{}]*)}/g,function(a,b){var r=params[b];return typeof r==='string'||typeof r==='number'?r:a;})},toQueryString:function(params){var pairs=[];for(key in params){if(params[key]!=null&¶ms[key]!=''){pairs.push([key,params[key]].join('='));}} | |
return pairs.join('&');}}} | |
UserVoice.Page={getDimensions:function(){var de=document.documentElement;var width=window.innerWidth||self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;var height=window.innerHeight||self.innerHeight||(de&&de.clientHeight)||document.body.clientHeight;return{width:width,height:height};}} | |
UserVoice.Dialog={preload:function(id_or_html){if(!this.preloaded){var element=document.getElementById(id_or_html);var html=(element==null)?id |
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> | |
<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"> |
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
<script type="text/javascript" src="http://api.mixpanel.com/site_media/js/api/mixpanel.js"></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 }; | |
} | |
</script> | |
... |
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
<!-- 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 = new MixpanelLib("YOUR_TOKEN"); |
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
mpmetrics.register({"ad campaign": "adwords1"}, "funnels"); |