简体   繁体   English

访问跟踪-服务器端/客户端

[英]Visit Tracking - server-side / client-side

I have an asp.net (webforms) application and I would like to track user visits to the site. 我有一个asp.net(网络表单)应用程序,我想跟踪用户对该站点的访问。 I have the DB, objects, basic idea down. 我把数据库,对象,基本思想都弄下来了。

My goal is to track a user from the first time he enters the site and up until he creates an account. 我的目标是跟踪用户,从他第一次进入网站开始直至创建帐户。 So I can trace back where this user came from in his initial visit (Organic, paid, referrer, etc.). 因此,我可以追溯到该用户在初次访问时来自何处(有机,付费,推荐人等)。

I am planning to create a cookie with a GUID for each initial visit, store all actions in the DB, and finally, when the user registers, I can go back and update a username field for all rows matching the GUID. 我打算为每次初次访问创建一个带有GUID的cookie,将所有操作存储在数据库中,最后,当用户注册时,我可以返回并更新与GUID匹配的所有行的用户名字段。

My problem is that I can't make up my mind on the best method to do this. 我的问题是我无法下定决心做到这一点的最佳方法。 Should I use an HTTP module and the session start and end events, or maybe ajax calls to a WCF backend? 我应该使用HTTP模块以及会话的开始和结束事件,还是对WCF后端进行ajax调用?

What would be the most efficient and accurate way to do this? 什么是最有效,最准确的方法?

Unless you plan on supporting anonymous sessions (which depending on traffic may or may not be an option), Session won't work. 除非您计划支持匿名会话(可能会或可能不会选择匿名会话),否则会话将无法工作。

The simplest thing that could work is simply putting a ticket (like your guid) in a cookie. 可行的最简单的方法就是将一张票(如您的GUID)放入cookie。 You can set and retrieve Cookies from your Page and use that to track the user. 您可以从页面设置和检索Cookies,并使用它来跟踪用户。 This does mean you'll only be able to track a user when he accesses from the same machine but until he's authenticated, you don't really have that much of a choice. 这确实意味着,只有当用户从同一台计算机访问时,您才能跟踪该用户,但是直到该用户通过身份验证为止,您实际上没有太多选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 RadTreeView上的客户端事件和服务器端事件冲突 - Client-side event and Server-side event conflict on RadTreeView 在服务器端捕获所有JavaScript客户端错误 - Catch all JavaScript client-side errors on the server-side 是更好的加载Twitter发布客户端或服务器端? - Is better load Twitter posts client-side or server-side? 客户端代码如何在服务器端运行? - How is client-side code run on server-side? 在客户端和服务器端都调用相同的方法 - Call same method both in client-side and server-side WCF回调未在客户端调用,并在服务器端挂起 - WCF callback not invoked on the client-side and hangs on the server-side 将服务器端和客户端身份验证与WebAPI结合使用 - Combine server-side and client-side authentication with WebAPI 客户端JS&服务器端C#通信 - Client-side JS & Server-side C# Communication 是否在客户端或服务器端完成了对CSS的转换? - Is LESS transformation to CSS done client-side or server-side? 将数据发布到web方法或将客户端数据转储到服务器控件然后获取数据服务器端是否更快? - Is it faster to POST data to a webmethod or dump client-side data to a server control and then get the data server-side?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM