From 9ee423933930863f495cdd56c78652a1a26155e3 Mon Sep 17 00:00:00 2001 From: pixelcodeUK Date: Wed, 6 Apr 2016 15:32:04 +0100 Subject: [PATCH] Code sample added Added Facebook HTML/JS code sample Added Kissmetrics tracking to sample --- _posts/2013-08-01-facebook-login.md | 90 ++++++++++++++++++++++++++++- 1 file changed, 88 insertions(+), 2 deletions(-) diff --git a/_posts/2013-08-01-facebook-login.md b/_posts/2013-08-01-facebook-login.md index 8b64525..cead0ae 100644 --- a/_posts/2013-08-01-facebook-login.md +++ b/_posts/2013-08-01-facebook-login.md @@ -35,11 +35,97 @@ These three statuses correspond to what call to Kissmetrics you should make: * `connected`: [automatically log in][auto-login] and record the ***Logged In*** event upon success. * `not_authorized`: prompt the visitor to login with `FB.login()` and record the ***Signed Up*** event upon success. -* `unknown`: prompt the visitor to login with `FB.login()`. Upon successful login, fetch more info (with `FB.api` perhaps) and record ***Logged In*** *or* ***Signed Up*** based on the results. +* `unknown`: prompt the visitor to login with `FB.login()` and assume a sign up (though they might have signed out of your app, and want to sign in again). ## Code Example -We have not personally worked with the Facebook SDK, so we don't have a working code example to provide. Please contribute below if you have recommendations! +When asking for information from the user via Facebook login, you get their email and basic profile information by default. If you want anymore information you need to have your app reviewed. + +[Public profile reference](https://developers.facebook.com/docs/facebook-login/permissions#reference-public_profile) + +Code example modified from [Facebook](https://developers.facebook.com/docs/facebook-login/web): + +```html + + + +Facebook Login JavaScript Example + + + + + + + +``` + +This code tracks a user logging in / signing up with Facebook, and then identifies them and sets properties to them. [fb-js-sdk]: https://developers.facebook.com/docs/reference/javascript/ [login-flow]: https://developers.facebook.com/docs/facebook-login/login-flow-for-web/