Web Analytics Made Easy -
StatCounter Quick Request.ServerVariables question - CodingForum

Announcement

Collapse
No announcement yet.

Quick Request.ServerVariables question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Quick Request.ServerVariables question

    Hi All,

    (like the new forums btw!)

    Just a quick question..

    Is there a way using ASP (i'll use JS if needs be) to find out the following from the user visiting my page!

    -/Script type/Javascript Version (must be easy but cant find anywhere)

    - Country visiting from (or at least keyboard type used)

    - Domains visiting my site

    - Keywords used from search engines to find my site and what the search engine was

    - Visitor frequency (ie when was the last time they visited



    ----- the above will probably be several different questions..
    but just seeing if i can get answers to most of them or whatever!

  • #2
    For visitor frequency, you could set a cookie and check that, and write the results to a database or something -

    For the last page accessed (which would give you the domain accessing your site), you can use:

    Request.ServerVariables("HTTP_REFERER")

    I believe it would be impossible to find out anything regarding the keyword search on search engines (unless it happens to be in the URL you get from HTTP_REFERER)...

    Don't know any way offhand to get the client's javascript version (with ASP that is, you can get it with javascript and send it to ASP though, using a hidden frame or refreshing perhaps), but you can get the browser type with:

    Request.ServerVariables("HTTP_USER_AGENT")

    Hope this helps!
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

    Comment


    • #3
      Some search engines add query string data to their links so you can determine the keywords used from that referring URL. For example, Google uses something like:

      http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=keyword1+keyword2

      A lot of log analyzers (WebTrends, LiveStats, etc.) use that info. You just have to know the format each search engine uses.

      Request.ServerVariables("REMOTE_ADDR") will give you the IP address of the user, or at least the IP address of his or her ISP. Those are assigned by Internet Registries so you can look them up to determine who owns them and what country they are based in. http://www.arin.net is a good place to start. Again, some web log analyzers can look those up automatically.

      The browser user agent string typically includes the browser's language. Problem is, every browser uses a different format so it's hard to parse programatically.

      Comment

      Working...
      X