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?
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