Link to home
Start Free TrialLog in
Avatar of prosit
prositFlag for United States of America

asked on

How to locate someone from a website.

Hi,

I was wondering how I get a physical location for a user when they visit my website?

It's ok if it has to ask the user if it's ok, but then I'd like to send the location information either to a database or an email... doesn't matter really.

I'd prefer asp.net, but at this point I don't really care.

Thanks
~j
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

You can't get a physical location for a user without asking them.  You can use one of the GeoIP services to get the location of their ISP but not the users actual location.  On one site, I'm actually doing both to cross check that what the user is filling out matches to some degree with their ISP location.  I see a number of forms filled out where the user says they're in the US but their ISP's IP address shows as being in Russia or India.  Or China.
Avatar of prosit

ASKER

Well I know there's an API from Google that will use your cell-phone's GPS information.

If they connect from a PC, (or MAC) it doesn't matter but cell phones and tablets should be possible.
I think you'll find that frequently blocked.
Avatar of prosit

ASKER

Blocked by who?
By the phone users.  People don't want to be tracked and they especially don't want their kids to be tracked.  Both iPhone and Android GPS can be turned off by the users.
Avatar of prosit

ASKER

Oh I know and understand, this is a service they actually agree to and want so they will acknowledge it. Or if not they won't get the service they're paying for.
Ok, please click on "Request Attention" above to get some other people to look at your question.  I can't help you with the .NET code.
I work with a very large global company I'm sure you've all heard of and have specific knowledge of this topic including privacy concerns.

The IP is concerned Personally Identifiable Information in many countries and collecting it without Opt In/Out can lead to lawsuits.  However, if you drop the last octet of an IP then you don't need approval.  That broadens the geo-IP to a large enough geographic location that individual identification is unlikely unless you combine other PII.

You can collect the IP without approval for legitimate business reasons.  For example, a banking website could collect it to protect against fraud.  Facebook would not have a legitimate case unless you agree to it.

However, there is another issue.  Getting the real IP where the client connects to the internet is actually quite hard to do consistently.  HTTP uses the X-Forwarded-For header to relay this client's public IP (where they connected to the internet provided by their ISP) however, many proxies do not relay that IP.  So, quite often you do not actually get the real geo-IP and instead will get the ISP of a network provider used by the ISP's the customer uses.  Or, a malicious customer might use Tor or their own proxy to hide their IP.

Google Analytics can do this work for you however once again, they can't be 100% reliable.
Simply ask them. I intensely dislike that I get German content because the main office is in Munich.
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>>> this is a service they actually agree to and want so they will acknowledge it.

Then why do you need all the nonsense with IP? Simple put a textbox on the page and let them tell you.  Store it in a db, cookie session or even local storage.   If they actually t4ell you where they are then that is going to be more accurate then any automated option you might try.  Of course they could lie.

Cd&
Avatar of prosit

ASKER

tedbilly,

I don't have any security or privacy concerns, people I'm looking for all signed a form that they agree.
julianH,

This might be useful, I was always thinking I'd have to pay for something :)

CobolDinosaur,

It's not that simple... I would not trust them to tell the truth if they were asked, therefore the automatic location would be preferred.

I can't go into details of what the business is, but it's not illegal or immoral in any way.  The people who's location I'm trying to get have agreed to this.  (signed document)
But if you cannot rely on their IPs geolocation then asking them might be a good idea
Well if you don't trust them when you ask them, your last reply is basically an explanation of why what you want to do is not feasible.  The core critical requirement cannot be done reliable by any means that you are willing to use, and you question the value of the one thing that should be reliable unless the users have some reason to lie.  Therefore you signed document is worthless because you have no way insure compliance.

Cd&
Avatar of prosit

ASKER

Very true... However asking them is no way of making sure they're not lying.  Automatically sending your coordinates to me is not easily fake'able.

And at the end of the day, it's better than having nothing.  If they refuse I'm still no better off than I was before.
Just a watchit to look out for. Some people (no names) are using proxies to hide their location - which you need to be aware of.

Also - depends on what location you are looking for - if where they are at that particular moment - then ok - but if you want their location to find out where they live then again data is going to be skewed for obvious reasons.
Avatar of prosit

ASKER

Completely understood, and honestly it's a very grey area for my client, but it's better than nothing basically.

Thank you
~j
I've requested that this question be closed as follows:

Accepted answer: 168 points for Dave Baldwin's comment #a40063322
Assisted answer: 166 points for tedbilly's comment #a40089008
Assisted answer: 166 points for julianH's comment #a40089181

for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
Avatar of prosit

ASKER

It wasn't really answered, but i'll close it.
Chip them...