Reporting visitor's IP address

   —   
This article shows how to get visitor's IP address and create a report of it.
Please see the following page for more details about creating custom reports:
devnet.kentico.com/docs/devguide/creating_custom_reports.htm

You can log the IP in the Global.asax.cs file. The IP is processed while logging the information about countries. You can log the IPs near that (there is the IP variable available). You could find these places by searching the file for the expression:
HitLogProvider.LogHit(HitLogProvider.COUNTRIES, siteName, null, countryName, 0) (there should be two occurrences).

Sample code of hit log:
//record ip
HitLogProvider.LogHit("IPaddress", siteName, null, ip, 0);



See also:

Applies to: Kentico CMS 3.x
Share this article on   LinkedIn

Juraj Ondrus

Hi, I am the Technical support leader at Kentico. I'm here to help you use Kentico and get as much as possible out of it.