2013-03-22 102 views
1

我創建了一個將在Facebook內部用作選項卡的網頁。 因此,用戶可以點擊一個自定義按鈕並將其發佈到牆上,我已經使用Feed對話框創建了一個自定義共享按鈕(下面的示例代碼)。帶有Facebook Feed對話框的自定義共享按鈕 - 跟蹤共享?

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/ 

是否有可能找出有多少人將他們分享到他們的牆上?我們希望在此頁面共享1000次時發佈一些內容,但不知道如何計算或監控共享數量。可能嗎?

回答

3

是的,它是不是這樣做的方式使用的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); 
0

回調只有一個RESPONSE_ID,你的確可以檢查它是否是共享的,但如果你有一個頁面上的多個sharebuttons它似乎沒有可能知道它來自哪裏以及增加什麼。

致以問候