You can do that with Universal Analytics, the new version of GA by generating a unqiue client id per logged in user and passing it to the tracker when it's being created.
ga('create', 'UA-XXXX-Y', {
'clientId': '35009a79-1a05-49d7-b876-2b884d0f825b'
});
(this is an example from Google UA Documentation, so while I haven't tested this yet I guess it should work).