Is it possible to find out how many times and how long a user is logged into a site using Google Analytics?
1 Answer
May be the session level custom variable is enough for you. You can use a custom variable scoped to the session level for user login status.
Async Snippet:
_gaq.push(['_setCustomVar',
1, // This custom var is set to slot #1. Required parameter.
'User Type', // The name of the custom variable. Required parameter.
'Member', // Sets the value of "User Type" to "Member" or "Visitor" depending on status. Required parameter.
2 // Sets the scope to session-level. Optional parameter.
]);
You can find more information in this page.