Im trying to store data of how many clicks and the amount of time a visitor spends on the site
Im sending the data to my php file with this ajax call.
window.onbeforeunload = function(){
var endTime = new Date();
var timeSpent = (endTime - startTime);
$.ajax({
url: baseUrl + siteDir + pathToDataXml,
type: "POST",
datatype: "html",
data: 'time='+timeSpent+'&clicks='+count,
})
return "Thank You For Participating";
}
the ajax call is hitting the php file as new records are being entered into the database, but the records are blank.
Any suggestions would be great