Score:0

Monitor session duration on AWS Cognito

ge flag

I am using AWS Amplify to host an Angular application and using Cognito user pool. I have created a dashboard on Amazon Quicksight for BI purposes. One of the metrics that I want to monitor is how much time a user spend in the application. Obviously I can't calculate the time that the user log out because not many users log out once they are done with the app. Do you have any idea on how I can achieve this metric?

I have contacted AWS support and here their answer:

Currently there is no metric that supports this function to track the login duration time of a user. The only metrics that are currently available for Cognito user pools are as mentioned in this link.

So it seems I can't track session duration using Cognito service. I asked the support whether if I can track it using Amplify service and here is their answer:

Actually AWS Amplify is just a framework that lets you build apps to use AWS Services in the background. Hence, when you use Amplify for authentication it is still using Cognito as the main authentication provider. Amplify has very limited metrics of its own as you can see from this link, however it does not include any metric for session duration.

Tim avatar
gp flag
Tim
You may need to track session duration within your application, including a timeout from the last interaction for when you assume they log off. From there you can push a custom metric to Cloudwatch if you want the data to be there.
ge flag
@Tim I think this is the best approach. So for now I get the session duration when a user closes the browser. Not the best approach but better than nothing. Can you post your answer so I can accept it?
Score:0
gp flag
Tim

You may need to track session duration within your application, including a timeout from the last interaction for when you assume they log off. From there you can push a custom metric to Cloudwatch if you want the data to be there.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.