Skip to content

Instantly share code, notes, and snippets.

@simpleshadow
Created March 13, 2013 17:04
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 simpleshadow/5154119 to your computer and use it in GitHub Desktop.
Save simpleshadow/5154119 to your computer and use it in GitHub Desktop.
It's not working. :'(
var trackEvent = {
"event": "test tracking pixel",
"properties": {
"token": "SHHH!IT'S_SECRET!",
"time": Date.now(),
"campaign": "ad4game"
}
};
var str = btoa(JSON.stringify(test));
var http_request = new XMLHttpRequest();
http_request.open( "GET", "http://api.mixpanel.com/track/?data="+str+"&ip=1");
http_request.onreadystatechange = function () {
if (http_request.readyState === 4 && http_request.status === 200) {
// Parse response
var response = JSON.parse(http_request.responseText);
console.log(response);
}
};
http_request.send(null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment