Developer forum

Forum » CMS - Standard features » Get Country information of visitor

Get Country information of visitor

Dennis van de Giessen
Reply

Hello,

I'm looking for a way to retrieve the actual country of a user when registering.

I tried the RegionInfo class of .NET but it keeps telling me I’m from the US (Should be NL)

I Also tried looking at some web services e.g.: (http://ip2c.org) that offer this functionality but they are either paid or I’m not sure if they collect user data. 

Also looked in downloading an IP to country database but we are not comfortable with maintaining/update these databases.

Also found that google has a way to display the users location based on geolocation (https://developers.google.com/maps/documentation/javascript/examples/map-geolocation). The problem is that the browser will the user for permission, this is not desired.

I was hoping that Dynamicweb has some sort of build in IP to country detection or any other way to correctly detect the users country. Or perhaps Dynamicweb has a web service we can use to translate IP to country so that we know our user data is not collected. I’m aware that a 100% detection is impossible, I'm aiming for 95-99% ish accuracy.

Thank you for your time,

Regards,

​Dennis


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Dennis

RegionInfo class of .NET gives you the regional settings of the server.

DW has a built in IP database, but the license limits the use of it and it also needs to be updated with new DW versions from time to time. So IP2Country DB is the best bet.

Or, you could simply take a look at the browsers accept language. It is not perfect, but takes you a long way.

BR Nicolai

 

You must be logged in to post in the forum