lowercase
lowercase

Reputation: 1220

Custom Share button with Facebook Feed Dialog - Track shares?

I've created A web page which will be used inside of Facebook as a tab. So users can click a custom button and post it to their wall, I have used the Feed Dialog to create a custom share button (facebook example code below).

https://www.facebook.com/dialog/feed?
app_id=458358780877780&
link=https://developers.facebook.com/docs/reference/dialogs/&
picture=http://fbrell.com/f8.jpg&
name=Facebook%20Dialogs&
caption=Reference%20Documentation&
description=Using%20Dialogs%20to%20interact%20with%20users.&
redirect_uri=https://mighty-lowlands-6381.herokuapp.com/

Is it possible to find out how many people shared this post to their wall? We want to release some content when this page is shared 1000 times but not sure how to calculate or monitor the number of shares. Is it possible?

Upvotes: 1

Views: 1857

Answers (2)

Fabio Antunes
Fabio Antunes

Reputation: 22882

Yes it is, instead of doing that way use javascript SDK

var obj = {
  method: 'feed',
  link: ,//yourlink
  picture: ,//the picture you want for the caption
  name: ,
  caption: ,
  description: ,
  display: 'popup'
};

function callback(response) {
   //here you can check the response and see if it was shared
   if (response && response.post_id){
     //then do an ajax request that increases the share count for example
   }
}

FB.ui(obj, callback);

Upvotes: 3

user3435322
user3435322

Reputation: 1

The callback only has a response_id and you can indeed check if it was shared, but if you have multiple sharebuttons on one page it does not seem to be possible to know where it came from and what counter to increment.

Best regards

Upvotes: 0

Related Questions