I\'m currently using jQuery to record each click on a Facebook share link on my site, but I\'m looking for a more accurate solution. Instead of recording the clicks, I\'d like t
Here's what I do....Create the share using normal anchor that calls this javascript function (spacing or brackets or something might be off):
FB.ui(
{
display:'iframe',
method: 'stream.publish',
caption: 'Put something here',
description: 'put something here',
name: 'foo',
link: 'http://www.foo.com',
picture: 'http://fo.com/img.gif'
},
function (response) {
if (response && response.post_id) {
//this means the post was completed....response.post_id is the FB post ID
$.ajax({
var URL = '/pages/ajax_InsertUserFacebookPost.aspx?';
URL += 'facebookpostid=' + response.post_id;
type: "GET",
url: URL,
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: true
});
} else {
//alert('Post was not published.');
}
}
);