开发者

Tracking unique visitors in Rails app - session or explicit cookie?

So here is the situation - I have a store app that I want to ultimately calculate the number of unique visitors to开发者_如何转开发 number of orders placed each day (basic conversion percentage). I am debating whether or not to store a visitor_id in Rails session or setting an explicit cookie on client. Either way, both would check to see if a visitor record has been created for the client by doing a lookup on the visitor table by IP address, http user agent, etc.

Now that I write this, I am thinking a cookie might be the best solution because I could create a unique identifier and store that in the cookie, then look up or create a visitor depending on that value..

Granted nothing is perfect since a "visitor" could switch computers, visit the site, and thus create another cookie / visitor record, but I am ok with that.

Further research brought me to this: How can I track repeated visitors using cookies

thoughts / best practices... :)

thanks!


It's the same because cookies are use to be define if it's the same session. Without cookie, you can't check your session.

But if you store session in server side, you can read it. But you can't read cookie if user never come back.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜