Using geolocation for contacts
Kentico EMS required
Features described on this page require the Kentico EMS license.
You can use geolocation to determine the origin (real world geographic location) of your website’s visitors based on their IP address. The system obtains the geographic data using MaxMind’s GeoIP databases. The default database is GeoLite City, the most accurate of the free IP geolocation databases. You can extend the accuracy of the feature by downloading additional databases.
Note
The system only determines the geographic location of contacts during their first visit on the website. The information isn’t updated when the same contact accesses the website again from a different location.
Configuring geolocation
To set up geolocation for your website:
Open the Settings application.
Navigate to On-line marketing -> Contact management -> Geolocation.
Check Enable contact geolocation by IP.
(Optional) Enter a geolocation Suffix.
- The system adds the suffix to the values of all text-based contact fields that are obtained using geolocation.
Configure the mappings of the GeoIP fields to Kentico contact fields.
Note
By default, Kentico contacts do not have an equivalent of the following fields:
- Area code
- Metro code
- DMA code
- Latitude
- LongitudeTo create custom fields for holding the data:
- Open the Modules application.
- Edit the Contact management module.
- On the Classes tab, edit the Contact management - Contact class.
- Define the fields on the Fields tab.
Field type restrictions
Mind the following type restrictions when assigning target fields for the GeoIP data:
Field |
Only accepts |
Country |
Integer-based and text-based columns.
|
State |
Integer-based and text-based columns.
|
City |
Text‑based columns. |
Postal code |
Integer‑based and text‑based columns. |
Area code |
Integer‑based and text‑based columns. |
Metro code |
Integer‑based and text‑based columns. |
DMA code |
Integer‑based and text‑based columns. |
Latitude |
Decimal‑based and text‑based columns. |
Longitude |
Decimal‑based and text‑based columns. |
Organization/ISP (GeoIPOrg required) |
Accepts text-based columns. Geolocation only updates this field if the GeoIP Organization Database is installed. |
- Click Save.
Managing your MaxMind databases
You can improve the functionality of geolocation by using more detailed and accurate databases and by keeping your current databases up to date.
Adding GeoIP City
The GeoIP CIty database provides more accurate results than the default GeoLite City database.
Obtain the GeoIP City database.
Place the database file into the ~/App_Data/CMSModules/WebAnalytics/MaxMind/ folder of your web project.
Configure the system to use the new geolocation database by adding the following key to the appSettings section of your web.config file.
- Specify the name of the database file as the key’s value.
<add key="CMSGeoIPLocationFileName" value="GeoIPCity.dat" />
Geolocation now uses the GeoIPCity.dat database instead of the default GeoLiteCity.dat database.
Adding GeoIP Organization
The GeoIP organization database allows the system to determine the organization name of visiting contacts.
Obtain the GeoIP organization database.
Place the database file into the ~/App_Data/CMSModules/WebAnalytics/MaxMind/ folder of your web project.
Note: The name of the database file must be GeoIPOrg.dat.
Geolocation now supports organization detection.
Updating existing databases
To ensure that the geolocation data is accurate, you need to regularly update your MaxMind databases. You can download the newest versions of the databases from the Kentico Client Portal. The databases are updated in the following intervals:
- GeoLite City - the first Tuesday of each month
- GeoIP City - weekly
- GeoIP Org - monthly
To update your databases, download the newest version and upload the database file to the ~/App_Data/CMSModules/WebAnalytics/MaxMind/ folder of your web project.