Track user activity

I am working on an ASP.NET site with SQL Server 2008 R2. I need to implement a tracking system to track user activity, which pages users viewed, which item they liked, etc. I have many options and have tried a couple of them.

  • I tried to send an insert from every page the user is viewing, but it put a huge load on the sql server and after two days I removed it
  • I had a solution: buffer user history in xml and flush them every 500 records in the database. it works fine, but it would be bad if the number of users increased.
  • I found that there are message queues like MSMQ and SQL Service Broker, but I didn't go any further with that.In the end, I would love to hear your suggestions and recommendations, as well as your comments for MSMQ and SQL Service broker, and if I should go after them and what one of them and why
+3


source to share


2 answers


You can try using a logging framework like log4net or nLog , which gives you the flexibility to log into a variety of targets, as well as buffering / asynchronous logging to reduce load.



+1


source


I would use something like Google analytics. It's easy, you just put the template code on your pages and google will do the rest.



+1


source







All Articles