Skip to content

Instantly share code, notes, and snippets.

@matclayton
Created October 22, 2011 16:18
Show Gist options
  • Save matclayton/1306158 to your computer and use it in GitHub Desktop.
Save matclayton/1306158 to your computer and use it in GitHub Desktop.
Is Facebook Connect for me?
<div id=”fb-root”></div>
<script>
window.fbAsyncInit = function(){
FB.init({ appId:‘YOUR ID’, status:true, cookie:true, xfbml:true});
FB.getLoginStatus(function(response){
_gaq.push([‘_trackEvent’, ’FB’, ‘status’, response.status]);
});
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment