Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tracking Facebook "Like" Referrals

Tags:

facebook

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 Likes. For example, I have an auto repair/maintenance client. They want to add a promo to their Welcome landing page that allows users to refer their friends to "Like" the company page. Once someone has referred 10+ "Like"'s, the company will then offer the referrer a free oil change or something. Any thoughts or idea here? I could not find a native App, but maybe I was not searching well enough.

like image 846
dMullins Avatar asked Mar 07 '11 14:03

dMullins


Video Answer


1 Answers

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" />
like image 72
ifaour Avatar answered Oct 20 '22 21:10

ifaour