Nuurek February 2016

Catch 'like it' event on FP Page Plugin

I have an fb-page plugin on sidebar, it is coded like that:

<div class="fb-page" data-href="https://www.facebook.com/XXX" data-width="300" data-height="200" data-small-header="true" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true">
    <div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/XXX"><a href="https://www.facebook.com/XXX">XXX</a></blockquote></div></div>

Is it possible to catch event when someone click on 'Like It' button?

Answers


luschn February 2016

https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/

Example:

FB.Event.subscribe('edge.create', function(url, html_element) {
    //like button clicked
});

Of course you have to create an App for this and include the JavaScript SDK in your page. More information about that, in case you donĀ“t know already:

Make sure you use FB.Event.subscribe right after FB.init.

Post Status

Asked in February 2016
Viewed 1,633 times
Voted 13
Answered 1 times

Search




Leave an answer