1

I am a new to this kinda implementation. I just wanted to know that, Is there any package in angular which could give the track and details of a user who has logged in .. The details needed to be:

1. Name of the user logged in.

2. Which page/route user is on.

3. Time spent on each page.

Is there any other way to handle this thing?

To save the details we have already a 3rd party application which will store the details.

Your help is much appreciated. Thank you!!!!

2
  • What do you mean by "track"? Showing a widget of some sort?
    – Alejandro
    Feb 1 at 12:22
  • 1
    @Alejandro no just catch details like how much user has spent time on a particular page, basically an analysis
    – user71494
    Feb 3 at 9:30
0

This is not really answer, since it doesn't recommend any software. However 1) it is too large for a comment, and 2) it tells you how to code what you are asking for.

1. Name of the user logged in.

You already know that right? You have a login screen where he typed it in, after all. Create a service and tell it about the log in.

2. Which page/route user is on.
3. Time spent on each page.

Each page is a component. Add code to 'ngOnInit()' for each page to tell the service that the user has chanegd page. The service should then start a timer, cancelling any previous timer. You now have the data that you wanted, although length of time on the final page if he navigates away without logging out might be problematic. This is left as an exercise for the reader ;-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.