This sounds like you sould just have to send an ajax request to the server (assuming you defined the global variable clicks
var url = 'yourUrl';
clicks++;
$('#yourBtn').click(function() {
$.ajax({
data: {url: url, clicks: clicks},
url: 'ajax/test.html',
success: function(data) {
alert('Load was performed.');
}
});
});