I want to track link clicks by user in my site. Essentially, all users will be logged in and will be provided with links to files to download and pages to visit. I need to log all actions by the user so that the data can be analysed at a later date. What's the best or preferred way to do this?
I've only ever seen aggregated tracking, not really user specific.
You could put a hook into page::init to store the page and member id, then for a download send the users to a page that sends the file. I think it would drive me crazy trying to track all user activity - even logging it almost crashed a server once due to the amount I was trying to record. Bottom line - choose what specifically needs tracking and add in custom hooks for it.
Google Analytics has the ability for you to add custom tracking parameters. You'd just need to modify your tracking JS code in the footer to include the values you want which would be generated by some code snippets that retrieve the information you need from the SS system. In fact I think it'd be relatively easy to add tracking for usernames by using Member::currentUser()