Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
492 views
in Technique[技术] by (71.8m points)

asp.net-mvc - ASP.NET跟踪代码和唯一身份访问者(ASP.NET Tracking Code & Unique Visitors)

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. Tracking 1) relative to timestamp etc

    (跟踪1)相对于时间戳等)

in asp.net mvc or just asp.net ?

(在asp.net mvc中还是在asp.net中?)

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

(PS-我知道可以使用Google Analytics(分析)等,但是出于对网络分析工作原理的兴趣而希望为自己创建一些基本统计信息?)

  ask by translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

(首先是使用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.

(为您要跟踪唯一身份的每个时间范围的用户创建一个cookie,因此您可以创建一个在一天之内到期而一个在一个月内到期的cookie。)

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,但这是非常准确的。)

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)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...