0

I do have Google Analytics on my site (tied to adwords), and have tried many other packages for tracking visitors, but none give me the detail I need. My goal is to keep the exact path visited, per IP.

All those tools work by adding a piece of code to the page, that goes to their server to save the page visit.

It occurred to me that I could save the IP and breadcrumbs in a SESSION array, and scrape the session files directory every few minutes to save the files before they expire.

Later I could decode those and do all kind of of data mining.

This way I don't have to modify the code, don't have to make each page visit go to an external site, and I believe this is less taxing than, let's say... a mysql record write at every page visit.

Would this be a bad idea for any reason I can't imagine yet?

Thanks for any input.

Henry
  • 1,374
  • 2
  • 14
  • 24

2 Answers2

1

What I would suggest is to use Apache access logs. Add any other information needed apart from default and be sure to log the session ID Cookie in access logs. This will allow you to group the data when data mining.

xelber
  • 4,197
  • 3
  • 25
  • 33
  • That sounds good. Not sure if I'd be able to modify the default logs without root access. Will definitely have the complete path once I group by IP and filter out all non-php records (jpg,css,etc). Thanks! – Henry Oct 31 '12 at 03:43
  • just don't forget that `ip != user`. – Marc B Oct 31 '12 at 04:31
1

It is possible to do nefarious things with $_SESSION, however, it is pretty safe. Your plan looks good.

On the other hand, users usually don't like it when you track them without their consent. Make sure you disclose the fact that you'll be tracking their every move.

Community
  • 1
  • 1
SomeKittens
  • 38,868
  • 19
  • 114
  • 143
  • I don't have any evil plans for the data. My goal is to actually IMPROVE customer service. I'd like to know what other products people saw before deciding which one to add to the cart, if people played with the qty up/down buttons in the cart and took advantage of quantity discounts, if people checked a product on different days before purchasing, etc. Adding a disclosure makes a lot of sense. Thanks! – Henry Oct 31 '12 at 03:55
  • The access logs option also seems to suit my needs. Will accept this one because I plan to try it first. Having the data already split by users on each single file may be simpler to handle. Thanks! – Henry Oct 31 '12 at 06:09