Wordpress Get User Location

Hiya,

It has been mentioned previously that the ability to grab the users location details would be handy.

https://premium.wpmudev.org/forums/topic/google-maps-and-geo-location-for-buddypress

I have found some plugins that grab the user IP to determine the country.

http://www.wp-geolocation.com/install-setup

http://www.someusefulinfo.com/affiliate-marketing/location-finder-wordpress-plugin-increase-sales/

I am hoping to center a google map on to the users country using WPMUDEV Google Maps plugin.

I am just looking to get the users country, not any thing more specific for the time being.

That should not be a privacy issue.

Could this not auto suggest the language as per WPML?

Does anyone have any suggestions on getting the user country?

Cheers

Johnny

  • Philip John
    • DEV MAN’s Apprentice

    Hiya,

    You'd just need something to do a reverse IP lookup on the user's IP address. That shouldn't cause any issues and won't be visible to the user.

    Or you could ask for the user's location through the browser although that will be more specific and will require user consent.

    Phil

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.