且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何轻松跟踪网站用户活动

更新时间:2023-12-02 09:51:10

使用谷歌分析,



它提供观看用户活动的解决方案,所有信息包括位置和用户浏览器和使用时间


我假设您知道如何获取所需的数据(页面名称,访问时间和其他详细信息),并且您只需要知道如何以最简单的方式收集数据。



如果您的网站使用代码,一种解决方案是在主母版页中包含代码。这样您就可以将所有代码放在自定义类中,并仅从主页面中的Page_Load调用此代码。



另一种解决方案是创建自定义http模块添加到IIS将截取请求并存储数据,而不会影响应用程序。


http://dotnetslackers.com/articles/aspnet/Tracking-User-Activity.aspx [ ^ ]


My website requires login in order to be able to download the report. After the people are registered and logged in I want to track all visitor activities so I can a get more details on visitor behaviour and gather more data for each individual user.

What are the different options for this? What would you recommend? Are there any already built in products for this. My goal is to store all data in database. So when someone is logged in and visits any page I would like to store page name, visit time and such in DB.

Main question is how to do this with least effort and not too many changes in existing application?

use google analytics ,

it provides solution for watching user activity and all the info include location and user browser and usage time


I''m assuming you know how to get teh data you need (page name, visit time and otehr details) and that you only need to know how to gather the data in the easiest possible way.

One solution would be to include code in the main master page if your website uses them. This way you can put all the code in custom classes and call this code only from Page_Load in main master page.

Another solution would be creating custom http module that will be added to IIS that will intercept requests and store the data w/o affecting application at all.


http://dotnetslackers.com/articles/aspnet/Tracking-User-Activity.aspx[^]