Track取消了facebook登录

Track canceled facebook login

本文关键字:登录 facebook 取消 Track      更新时间:2023-09-26

我希望跟踪那些出现Facebook登录对话框的用户,并选择关闭它(通过点击"取消"或只是关闭弹出窗口)。

我正在使用Facebook SDK并调用FB.login()

文档它是不清楚的,但它确实出现可能有一些方法来跟踪这一点,所以,如果有人在这里知道如何,或可以帮助,它将是感激的。谢谢!


完整代码:

var facebook = (function(){
    //  Configuration
    var serverDomain = '365scores.com',
        appID        = '158698534219579';
    // Load the 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 this page
            version    : 'v2.0' // use version 2.0
        });
        FB.getLoginStatus(FBLoginStatus);
        FB.Event.subscribe('auth.authResponseChange', FBLoginStatus);
    };
    function FBLoginStatus(response){
        // The response object is returned with a status field that lets the
        // app know the current login status of the person.
        // Full docs on the response object can be found in the documentation
        // for FB.getLoginStatus().
        if( response.status === 'connected' ){
            // Logged into your app and Facebook.
            //connected(response);
            $(document).trigger('connection', ['facebook', response]);
        }
        else if( response.status === 'not_authorized' ){
          // The person is logged into Facebook, but not your app.
        }
        else{
          // The person is not logged into Facebook, so we're not sure if
          // they are logged into this 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){
        });
        */
    }
    return FBLoginStatus;
})();
FB.login(function(response) {
   if (response.authResponse) {
     console.log('Welcome!  Fetching your information.... ');
     FB.api('/me', function(response) {
       console.log('Good to see you, ' + response.name + '.');
     });
   } else {
     console.log('User cancelled login or did not fully authorize.');
   }
 });