Carter Gilchrist
posted this on August 02, 2011 04:19 pm
IMPORTANT: Unfortunately the script on this article is no longer working to track conversions for Facebook Like buttons that have been manually embedded to landing pages. We understand that tracking different conversion types is important for most of your online campaigns and we would love to hear your feedback in our community forum at GetSatisfaction.
If the goal of your page is to acquire Facebook "likes", then it would make sense that you want to track those as conversions in order to run an A/B test. I've outlined how to get that working below:


<html> tag at this point yet, which might result in this not working properly in older versions of I.E.
<script type="text/javascript">
FB.Event.subscribe('edge.create', function(response) {
// This will track a conversion in Unbounce
jQuery.get('/clkg/http/facebookLike');
});
</script>
That's all there is to it! You should start to see your conversions go up when the Like button is pressed.
Comments
This is cool. Thanks for sharing. Quick question though... If this only works with the FBML embed code, how do we get the XML namespace (<html xmlns:fb="http://ogp.me/ns/fb#">) in the head tag? Oli said you can't do that back on June 10 (http://support.unbounce.com/entries/307681-adding-a-facebook-widget-using-facebook-s-iframe-code).
We are trying to implement xfbml Facebook like button in our page. But after putting the code for the Java Script together with the code into a html box nothing happens. Also putting the JS in the Script database and juste the code in a html isn't working. How do you did it Carter?
Hi Matthias - thanks for your message.
Unfortunately the script on this article is not longer working to track conversions for Facebook Like buttons that have been manually embedded to landing pages. We understand that tracking different conversion types is important for most of your online campaigns and we would love to hear your feedback in our community forum at GetSatisfaction.
However, we do recommend the social widgets tool that is now available in the main Unbounce page editor. Although they cannot tracked as conversions for the page, they are still a great way to enable your users to share your campaign with others. To learn more about social widgets, please visit http://support.unbounce.com/entries/21263181-how-to-add-social-medi...
Please don't hesitate to let us know if you have any further questions regarding this topic.
Cheers,
Jacquelyn | Unbounce Customer Success