I'm trying to integrate messenger on my website. I want to track users (by Cookie Value). There is a option in Facebook Chat Plugin, "messaging_referrals" which tells referral key of user chatting.
As per instructions i have added event "messaging_referrals" in facebook app webhook events.
But still in my webhook i'm not getting referral key.
My Plugin Code looks like this
<div class="fb-customerchat"
page_id="ABC"
ref="OPTIONAL_WEBHOOK_PARAM"
logged_in_greeting="<GREETING_MESSAGE_FOR_LOGGED_IN_USERS>"
logged_out_greeting="<GREETING_MESSAGE_FOR_LOGGED_OUT_USERS>">
</div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'XYZ',
autoLogAppEvents : true,
xfbml : true,
version : 'v2.11'
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "https://connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
And Request I'm getting in my webhook is this
"data": {
"sender": {
"id": "abc"
},
"recipient": {
"id": "ABC"
},
"message": {
"mid": "mid.$cAADv109V6n_F6BY",
"text": "hi",
"seq": 511,
"tags": {
"source": "customer_chat_plugin"
}
},
"timestamp": 1522049646776
}
As per this i should also be receiving "OPTIONAL_WEBHOOK_PARAM" in my webhook request

referral.reffield in the webhook response as per the official docs. Replied "No" to the "Is this page helpful?" survey on the bottom left of the doc page, checked "Accuracy" and described the lack of support/docs for ref. - OXiGEN