IP Lookup Function

SHANE EBERT asked on July 18, 2017 22:45

From what I am aware, software like Marketo and Hubspot can tell you who has been on your site without someone filling out a form. Does Kentico have this ability?

Thanks

Recent Answers


Zach Perry answered on July 18, 2017 23:09

Contacts in the Online marketing module will log IP address of visitors if that setting is enabled.

1 votesVote for this answer Mark as a Correct answer

Peter Mogilnitski answered on July 19, 2017 16:25 (last edited on December 10, 2019 02:31)

You can do it pretty much yourself without marketing. You have API for that:

GeoLocation currentGeoLocation = GeoIPHelper.GetCurrentGeoLocation();
if (currentGeoLocation != null)
{
    var countryAndState = ValidationHelper.GetString(currentGeoLocation.CountryName, "");
    var ipCountryCode = ValidationHelper.GetString(currentGeoLocation.CountryCode, "");
    var ipRegion = ValidationHelper.GetString(currentGeoLocation.RegionName, "");
    var ipCity = ValidationHelper.GetString(currentGeoLocation.City, "");
}    

Or using K# macros:

{% AnalyticsContext.CurrentGeoLocation.Country.CountryName|(identity)GlobalAdministrator%}

The database comes from MaxMind. You can learn more about managing it here

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.