2 Replies Latest reply on May 6, 2006 4:35 PM by Homestar9

    Tracking Hits Vs. Visits

    Homestar9 Level 1
      Hello All,

      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.

      For example:
      1. User clicks link
      2. CF template stores the request in the database along with the date/time
      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.

      Any thoughts?

      David Levin
        • 1. Tracking Hits Vs. Visits
          I haven't done it by I assume by making a cookie the first time they click & then seeing if the cookie exists to ignore the additional hits. But you probably already thought of the cookie.

          OOPS! ... didn't read the whole post, sorry.
          • 2. Re: Tracking Hits Vs. Visits
            Homestar9 Level 1
            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 login,
            1. cookies
            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 accurate results if you use cookies to track unique page visits.