Internet CLient side information
What is the safest method of establishing the country origin of the client browser.
I would very much appreciate some information that would help me to statistically know the audience visiting a web site.
Web Development
What is the safest method of establishing the country origin of the client browser.
I would very much appreciate some information that would help me to statistically know the audience visiting a web site.
by jay eckles
I have a statistical package called Sawmill (http://www.flowerfire.com/sawmill) that provides very detailed information based on the data stored in my web server logs. Country is one of the statistics provided.
What you do is look at the top-level domain in the value of REMOTE_ADDR or REMOTE_HOST environment variables when a request is made. If the value is an IP address and not a hostname, you can try a reverse lookup to get a hostname from the IP address. The TLD will tell you what country the person is purportedly coming from - .com, .net, .edu, .org, .mil, .gov, .us are all US TLDs. Beyond that, every country has their own TLD - .uk = United Kingdom, .ca = Canada, .mx = Mexico, .fr = France, etc. The only caveat is that many foreign internet companies use .com addresses, so using it as an indicator of US origin is flaky at best.
Of course, the safest method of establishing the country of origin is probably to ask the user...
Good luck.
Jay Eckles
www.jayeckles.com
by sarel
by sarel
This discussion is closed to new replies.
Sort by Trending