General discussion

Locked

Internet CLient side information

By Sarel ·
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.

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Internet CLient side information

by Jay Eckles In reply to Internet CLient side info ...

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

Collapse -

Internet CLient side information

by Sarel In reply to Internet CLient side info ...

This I was already aware of, yet I was hoping that there may be a more definite way of getting more accurate statistics on the country of origin of the client machine.

Collapse -

Internet CLient side information

by Sarel In reply to Internet CLient side info ...

This question was closed by the author

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums