views:

48

answers:

1

Hi,

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: http://stackoverflow.com/questions/2025577/how-can-i-track-repeated-visitors-using-cookies

thoughts / best practices... :)

thanks!

A: 

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.

shingara
after reading more about rails sessions I started to see the light on this - thanks for the feedback!
drpepper