From c128a5d15dba6f2715906e8a1a6714b942a6f886 Mon Sep 17 00:00:00 2001 From: raylu Date: Sun, 6 Nov 2011 14:41:33 -0800 Subject: add mp tracking for the Go! button --- js/mapspecs.js | 28 ++++++++++++++++++---------- 1 file 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() { -- cgit v1.2.3