I would like to track how many site visitors are downloading
specific files from my web application. I have set up a template
that records the time/date the user requests the file into an
ActivityTracking table in my db, and then dynamically sends them
the file via CFCONTENT.
1. User clicks link
2. CF template stores the request in the database along with
3. CF sends the user the file via CFCONTENT
I want to be able to distinguish between someone repeatedly
downloading the same file (hits), and someone downloading it for
the first time within a given time frame (visits).
My first instinct was to put a cookie on a user's machine
after they download the file, and look for that cookie, the next
time they click on the link. However, if the user has cookies
disabled or deletes their cookies, this method won't work. The site
would see this as a new visitor.
My next instinct was to check the IP address of the user and
look for a duplicate within my Activity Tracking table in the
database. However, if the user is behind a proxy, firewall, etc. I
may not get an accurate count of visitors downloading the file.
There must be a way to utlize both methods (or perhaps an
even better method) for figuring out if the user has downloaded the
file before (say, within a given timeframe like 1 hour).
I've seen this kind of logic before in online polls. For
example, the polls on the howard stern web site www.howardstern.com
do a very good job at ensuring no duplicate poll submissions from
the same computer, but still allow different computers with the
same IP to access the poll. I can fill out their poll, delete my
cookies, block cookies, and not be allowed to re-submit the poll
again. I can then go to my laptop which uses the same external IP
address as my desktop and be able to fill out the poll as if I was
a new user. If the system were blocking the IP, they would have
blocked my laptop too. This is the type of logic I would like to
use for my web application.
I figured out how the howardstern.com web site does it: They
look at a combination of IP address and CGI.USER_AGENT. It's a bit
more accurate than using IP Address alone, but not perfect.
After all my research probing google for the answer the
bottom line is this:
There are two ways to track site visits without requiring
2. IP Address/User_Agent combination.
When you look at the percentage of computers not utilizing
cookies, it is much lower than computers behind the same IP address
with matching user agents. (I found a great web site that broke
down the advantages and disadvantages of both - I'll see if I can
find it and post the link here). Therefore you can get more