0

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.

  • 1
    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. – Tim May 25 '22 at 08:15
  • @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? – Fariman Kashani May 26 '22 at 07:49

1 Answers1

0

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.

Tim
  • 30,383
  • 6
  • 47
  • 77