diff options
author | raylu <raylu@mixpanel.com> | 2011-11-06 14:41:33 -0800 |
---|---|---|
committer | raylu <raylu@mixpanel.com> | 2011-11-06 14:41:33 -0800 |
commit | c128a5d15dba6f2715906e8a1a6714b942a6f886 (patch) | |
tree | 2d5c9faf4805e8f7fb61202216565ed5d0784d2e /js | |
parent | d30b058fda2ca9ed44dfb55f38db8ab647865549 (diff) | |
download | pathery-c128a5d15dba6f2715906e8a1a6714b942a6f886.tar.xz |
add mp tracking for the Go! button
Diffstat (limited to 'js')
-rw-r--r-- | js/mapspecs.js | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/js/mapspecs.js b/js/mapspecs.js index 79e93aa..e897bbb 100644 --- a/js/mapspecs.js +++ b/js/mapspecs.js @@ -128,23 +128,31 @@ function doSend(mapid) { if (solution[mapid] == undefined) {
getmapdata(mapid);
}
-
- reqstr = "";
- reqstr += "&mapcode="+mapdata[mapid].code;
+
+ reqstr = "&mapcode="+mapdata[mapid].code;
reqstr += "&mapid="+mapid;
reqstr += "&solution="+solution[mapid];
-
+
//document.getElementById('dispdo').innerHTML = "http://mazetd.4xg.net/do.php?r=getpath"+reqstr
-
- ajax.requestFile = "do.php?r=getpath"+reqstr; //prepare strdata
- ajax.onCompletion = request_path_done; // Specify function to be executed on response.
- ajax.runAJAX();// Do it!
+
+ ajax.requestFile = "do.php?r=getpath"+reqstr; //prepare strdata
+ ajax.onCompletion = request_path_done; // specify function to be executed on response
+ ajax.runAJAX();
+
+ var speedbox = document.getElementById(mapid+',speed'),
+ speed = speedbox.options[speedbox.selectedIndex].text,
+ mute = !checkSound(mapid);
+ mpq.track('click go', {
+ 'speed': speed,
+ 'mute': mute,
+ 'mapid': mapid
+ });
}
function requestSol(solid) {
ajax.requestFile = "do.php?r=getsol&solutionid="+solid; //prepare strdata
- ajax.onCompletion = requestSolDone; // Specify function to be executed on response.
- ajax.runAJAX();// Do it!
+ ajax.onCompletion = requestSolDone; // specify function to be executed on response
+ ajax.runAJAX();
}
function requestSolDone() {
|