ASP.NET跟踪代码和唯一访问者

时间:2021-02-05 15:18:35

I am trying to find a way to track and produce reports for my site (out of interest). Does anyone know of any articles/projects etc that you can

我正试图找到一种方法来跟踪和生成我的网站的报告(出于兴趣)。有没有人知道你可以做的任何文章/项目等

  1. Track pages / unique visitors etc
  2. 跟踪页面/独特访客等

  3. Tracking 1) relative to timestamp etc
  4. 跟踪1)相对于时间戳等

in asp.net mvc or just asp.net ?

在asp.net mvc或只是asp.net?

P.S - I know google analytics etc is available but looking to create some basic stats for myself out of interest about how web analytics work ?

P.S - 我知道谷歌分析等可用,但希望为自己创建一些关于网络分析如何工作的基本统计数据?

5 个解决方案

#1


There are a couple of good ways to try and determine unique visitors, none of them are exact (which is why different analytics will report different numbers).

有几种很好的方法可以尝试确定唯一身份访问者,但没有一种是准确的(这就是为什么不同的分析会报告不同的数字)。

The first is to use a cookie. Create a cookie for the user for each time frame that you want to track uniques, so you could create one that expires in a day and one that expires in a month. You can then use both of those to track how many unique daily/monthly visitors you have. Of course this is not perfect since people can clear or refuse cookies, but it is pretty accurate.

第一种是使用cookie。为要跟踪唯一身份用户的每个时间段为用户创建一个Cookie,这样您就可以创建一个在一天中过期而一个在一个月内过期的cookie。然后,您可以使用这两者来跟踪您拥有的每日/每月唯一访问者数量。当然这并不完美,因为人们可以清除或拒绝cookie,但它非常准确。

The other way is to track uniques using a combination of the IP address and User Agent of the requesting user, this is probably slightly less accurate since if a company has a good IT group lots of internal users will have the same User Agent and since they are all coming from the same internal network could have the same IP address.

另一种方法是使用请求用户的IP地址和用户代理的组合来跟踪唯一身份,这可能稍微不准确,因为如果公司拥有良好的IT组,许多内部用户将具有相同的用户代理,并且因为他们所有来自同一内部网络的都可以拥有相同的IP地址。

If you are interested in reading more about the different methods there is a great article about it here: http://www.google.com/support/urchin45/bin/answer.py?answer=28325

如果您有兴趣阅读有关不同方法的更多信息,请在此处找到一篇很棒的文章:http://www.google.com/support/urchin45/bin/answer.py?answer = 28325

#2


I blogged about simple asp.net module.

我在博客上写了关于简单的asp.net模块。

You can check it here
http://ilkeraksu.com/post/2009/07/14/Very-very-simple-But-very-very-efficient-Aspnet-Tracking-module.aspx

你可以在这里查看http://ilkeraksu.com/post/2009/07/14/Very-very-simple-But-very-very-efficient-Aspnet-Tracking-module.aspx

#3


I would recommend using google analytics instead of reinventing the wheel. All you have to do is stick a bit of javascript in your master page and your done.

我建议使用谷歌分析而不是重新发明*。您所要做的就是在主页面中添加一些javascript并完成。

#4


Yo can check Piwik out. Its an open source web analytics written using PHP and mysql.

哟可以检查Piwik了。它是一个使用PHP和mysql编写的开源Web分析。

#5


you can find great article in
http://www.codeproject.com/KB/aspnet/PageTracking.aspx
which is upgraded version of
http://www.15seconds.com/Issue/021119.htm

你可以在http://www.codeproject.com/KB/aspnet/PageTracking.aspx找到很棒的文章,它是http://www.15seconds.com/Issue/021119.htm的升级版本

with help of a Session Tracker class that runs in Application_PreRequestHandlerExecute and mailing reports on session end and lot of usefull tips

借助在Application_PreRequestHandlerExecute中运行的Session Tracker类和在会话结束时发送邮件报告以及许多有用的提示

thanks Wayne Plourde for all that stuff

谢谢Wayne Plourde所有的东西

#1


There are a couple of good ways to try and determine unique visitors, none of them are exact (which is why different analytics will report different numbers).

有几种很好的方法可以尝试确定唯一身份访问者,但没有一种是准确的(这就是为什么不同的分析会报告不同的数字)。

The first is to use a cookie. Create a cookie for the user for each time frame that you want to track uniques, so you could create one that expires in a day and one that expires in a month. You can then use both of those to track how many unique daily/monthly visitors you have. Of course this is not perfect since people can clear or refuse cookies, but it is pretty accurate.

第一种是使用cookie。为要跟踪唯一身份用户的每个时间段为用户创建一个Cookie,这样您就可以创建一个在一天中过期而一个在一个月内过期的cookie。然后,您可以使用这两者来跟踪您拥有的每日/每月唯一访问者数量。当然这并不完美,因为人们可以清除或拒绝cookie,但它非常准确。

The other way is to track uniques using a combination of the IP address and User Agent of the requesting user, this is probably slightly less accurate since if a company has a good IT group lots of internal users will have the same User Agent and since they are all coming from the same internal network could have the same IP address.

另一种方法是使用请求用户的IP地址和用户代理的组合来跟踪唯一身份,这可能稍微不准确,因为如果公司拥有良好的IT组,许多内部用户将具有相同的用户代理,并且因为他们所有来自同一内部网络的都可以拥有相同的IP地址。

If you are interested in reading more about the different methods there is a great article about it here: http://www.google.com/support/urchin45/bin/answer.py?answer=28325

如果您有兴趣阅读有关不同方法的更多信息,请在此处找到一篇很棒的文章:http://www.google.com/support/urchin45/bin/answer.py?answer = 28325

#2


I blogged about simple asp.net module.

我在博客上写了关于简单的asp.net模块。

You can check it here
http://ilkeraksu.com/post/2009/07/14/Very-very-simple-But-very-very-efficient-Aspnet-Tracking-module.aspx

你可以在这里查看http://ilkeraksu.com/post/2009/07/14/Very-very-simple-But-very-very-efficient-Aspnet-Tracking-module.aspx

#3


I would recommend using google analytics instead of reinventing the wheel. All you have to do is stick a bit of javascript in your master page and your done.

我建议使用谷歌分析而不是重新发明*。您所要做的就是在主页面中添加一些javascript并完成。

#4


Yo can check Piwik out. Its an open source web analytics written using PHP and mysql.

哟可以检查Piwik了。它是一个使用PHP和mysql编写的开源Web分析。

#5


you can find great article in
http://www.codeproject.com/KB/aspnet/PageTracking.aspx
which is upgraded version of
http://www.15seconds.com/Issue/021119.htm

你可以在http://www.codeproject.com/KB/aspnet/PageTracking.aspx找到很棒的文章,它是http://www.15seconds.com/Issue/021119.htm的升级版本

with help of a Session Tracker class that runs in Application_PreRequestHandlerExecute and mailing reports on session end and lot of usefull tips

借助在Application_PreRequestHandlerExecute中运行的Session Tracker类和在会话结束时发送邮件报告以及许多有用的提示

thanks Wayne Plourde for all that stuff

谢谢Wayne Plourde所有的东西