javascript - Track canceled facebook login -



javascript - Track canceled facebook login -

i wish track users presented facebook login dialog popup, , chose close (by clicking "cancel" or closed popup window).

i using facebook sdk , invoking fb.login()

from docs it's unclear, appear there might way track this, so, if here knows how, or can help, appriciated. thanks!

complete code: var facebook = (function(){ // configuration var serverdomain = '365scores.com', appid = '158698534219579'; // load sdk asynchronously (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 = "//connect.facebook.net/en_us/sdk.js"; fjs.parentnode.insertbefore(js, fjs); }(document, 'script', 'facebook-jssdk')); window.fbasyncinit = function(){ fb.init({ appid : appid, cookie : true, // enable cookies xfbml : true, // parse social plugins on page version : 'v2.0' // utilize version 2.0 }); fb.getloginstatus(fbloginstatus); fb.event.subscribe('auth.authresponsechange', fbloginstatus); }; function fbloginstatus(response){ // response object returned status field lets // app know current login status of person. // total docs on response object can found in documentation // fb.getloginstatus(). if( response.status === 'connected' ){ // logged app , facebook. //connected(response); $(document).trigger('connection', ['facebook', response]); } else if( response.status === 'not_authorized' ){ // person logged facebook, not app. } else{ // person not logged facebook, we're not sure if // logged app or not. } }; function checkloginstate() { fb.getloginstatus(function(response) { fbloginstatus(response); }); } function connected(res){ console.log( res ) console.log('facebook conencted'); /* fb.api('/me', function(response){ }); */ } homecoming fbloginstatus; })();

fb.login(function(response) { if (response.authresponse) { console.log('welcome! fetching information.... '); fb.api('/me', function(response) { console.log('good see you, ' + response.name + '.'); }); } else { console.log('user cancelled login or did not authorize.'); } });

javascript facebook google-analytics

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -