Is there any possibility using the Google Analytics API to check if the session is logged in or not? I have a problem with destination page (it is not set), and I want to resend the event when the session is not logged in.
Force sending event for sessions without a logged in user
google;google analytics;google search console;logging;session
You can use something like this1) Set up onBeforeAction hooks to login the user automatically (which asks for credentials if user is not logged in to external service)var loginWithGoogle = function() {  if (bla.isClient) {    Session.set('loginError', undefined);    bla.loginWithGoogle({      loginStyle         : redirect,      requestPermissions : ['profile', 'email'],      requestOfflineToken: true    }, function (err) {      if (err)        Session.set('loginError', 'reason: ' + err.reason + ' message: ' + err.message || 'Unknown error');    });  }}var requireLogin = function() {  if (! bla.user()) {    if (bla.loggingIn()) {      this.render(this.loadingTemplate);     } else {      console.log('Some crazy stuff');      loginWithGoogle();    }  } else {    this.next();  }}Router.onBeforeAction(requireLogin, {except: ['some-special-public-route']});2) Log the user out when they are navigating away from every page (caveat: login/logout gets called everytime the user navigates within the app)bla.startup(function(){    $(window).bind('beforeunload', function() {        closingWindow();    });});closingWindow = function(){    console.log('You are leaving.');    bla.logout();}