Is it possible to update database once a user shared a link in my website?
Such as,some points will be awarded to their account if they shared the link.
And how can I ensure that they really share the link to facebook but not just click share then close the popup window…
I’m not familiar with facebook , and tried google it just now but still didn’t find the answer…
Thank you.
Edit:
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share"
type="text/javascript">
</script>
<a name="fb_share" type="button" share_url="script2.php?id=XXX">
Update(Aug 21, 2013): Facebook’s api has changed since the time this was originally posted. The way to track likes is still the same (read original answer below), but the status of the share button has changed.
The deprecation message/info. is no longer visible anywhere in the docs, but it can be seen in this bug. The share button still seems to be usable according to this doc. But there is no direct way from facebook to track a share. I’m not aware of any hacks to track shares either.
Original answer:
From Facebook docs at this link.
So I’ll tell you how to do it for a like button:
First use the Javascript sdk
Somewhere in your page include the like button
You can also change the word that is displayed in the like button, from like to recommend, you should try and auto-generate your like button code from this link.