I need to track user logins so I know how often "UserA" is logging into my site. Can anyone recommend a method to do this? Module or code?
closed as off-topic by kiamlaluno♦ Aug 7 at 5:54
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions asking to recommend or find a book, tool, module, theme, distribution, tutorial, or other off-site resource are off-topic for Drupal Answers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – kiamlaluno
I think you are looking for User Stats module.
Provides commonly requested user statistics for themers, IP address tracking and Views integration. Statistics are:
- days registered;
- join date;
- days since last login;
- days since last post;
- post count;
- login count;
- user online/offline;
- IP address;
Just to close off this question I will share how I managed to track the user login times.
I simply wrote a module that added a table to the db and on login I would add the login/user event + date-time to the table.
Then I was able to access how many times and at what time users were logging in. This was something I wasn't able to get from the User Stats module.
A simple module that tracks each time a user logs in and stores a historical record in your database. This data is then exposed to views so you can report on it if required.
Logs minimal data: user ID, and time logged in Ability to exclude users from tracking by role Hooks to allow fine-grained control over which logins get tracked Hooks to allow you to add information to the data stored Views integration
it's available on both Drupal 7, 8