Is there a way to determine if a user shared a result without using the social network's Javascript SDK? All sharing aspects (authorization, sharing, etc.) are done through popups on my domain.
var popup = window.open('/api/share/' + service + '/page/123', '', 'top=' + top + ', left=' + left + ', width=400, height=500');
Once the sharing popup opens, the user can choose to click on the social service's share button and then close the popup. However, they also have the option to simply close the popup without sharing anything. How can I track whether the user actually shared or just closed the popup?
If I were to use the social network's Javascript SDK, like the Facebook Javascript SDK for example, it would be straightforward:
$('#shareButton').click(function() {
FB.ui({
method: 'feed',
link: 'https://developers.facebook.com/docs/dialogs/',
caption: 'An example caption',
}, function(response) {
if (response === null) {
console.log('user closed the popup without sharing');
} else {
console.log('user successfully shared a post ' + response.post_id);
}
});
});
My webpage includes Facebook, Google+, Twitter, and Vkontakte social networks, and I prefer not to add all four Javascript SDKs (especially since Twitter lacks a JS SDK).