This is not related to tracking Facebook \"Likes\" from an independent website. I am specifically looking to find if the Facebook API supports tracking of referrals via Lik
I'm not sure if I understood your question correctly, but let me try:
You have a website http://client.com/
which has a referral system, for example user A (which id = 1234
) will have a referral URL:http://client.com/landing_page.php?ref_id=1234
And on this page, you have a Facebook like button. You need to "capture" if a certain likes to the Company page came from this URL?
Okay, Facebook provides an event to track when a user "likes" something. It's called edge.create from there you can increment the user referrals.
For example on the page (landing_page.php
) http://client.com/landing_page.php?ref_id=1234
you'll have something like:
FB.Event.subscribe('edge.create', function(response) {
$.ajax({
type: 'POST',
url:'/referral_manager.php',
data: {ref_id: <?php echo $ref_id_or_user_id; ?>}
});
});
Where $ref_id_or_user_id
can be taken from the URL when processing the page.
Now on the referral_manager.php
you do your checking if a certain amount is reached to send a user a coupon (gift).
IMPORTANT NOTE:
One very important and crucial point here is to set the Open Graph Meta Tags to the same data in all the pages, not doing so...Facebook will treat these pages as different pages! For example all referral URLs (http://client.com/landing_page.php?ref_id=xxxx
...etc) should have:
<meta property="og:title" content="Same Title" />
<meta property="og:type" content="company" />
<meta property="og:url" content="http://client.com/" />
<meta property="og:image" content="http://client.com/img/logo_to_share.jpg" />
<meta property="og:site_name" content="Client Name" />
<meta property="fb:admins" content="XXXXXXX" />