Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > On-line Marketing: Geolocation View modes: 
User avatar
Member
Member
mosgath - 10/19/2012 10:56:25 AM
   
On-line Marketing: Geolocation
Does the Online Marketing Geo-Location handle forwarded requests through a proxy by using the X-Forwarded-For HTTP Header or does it only go by Client IP?

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 10/22/2012 4:35:08 AM
   
RE:On-line Marketing: Geolocation
Hi,

Yes, Geo-Location in Online Marketing is resolved by the clients IP address.

Best regards,
Martin Danko

User avatar
Member
Member
mosgath - 12/14/2012 2:42:32 PM
   
RE:On-line Marketing: Geolocation
Is there a setting that I can flag this to use the first IP address in the X-Forwarded-For header instead of Client IP? The issue is that we have Kentico on a server behind a reverse proxy server. The client IP address will be the proxy's IP address. Yet we need to be able to use the X-Forwarded-For for Online Marketing and web analytics.

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 12/17/2012 12:07:27 PM
   
RE:On-line Marketing: Geolocation
Hi,

As I said "Geo-Location in Online Marketing is resolved by the clients IP address.", so I mean just and only by IP address and at the moment, unfortunately, it's not possible to change that (by header, etc.).
However, you can add, and other users can vote for your requirement, use our special page - Kentico UserVoice.

Best regards,
Martin Danko

User avatar
Member
Member
mosgath - 12/17/2012 1:11:12 PM
   
RE:On-line Marketing: Geolocation
Thanks. It has been requested under the Online Marketing Feature.

User avatar
Member
Member
Accepted solutionAccepted solution
mosgath - 12/19/2012 9:55:31 AM
   
RE:On-line Marketing: Geolocation
I got a response back from my user voice request on how to accomplish this. Below is sample code that was added to the Global.asax.cs file. Additional checks/parsing of Server variable may be required.

//Additional Directive
using CMS.GlobalHelper;

//New code
void Application_BeginRequest(object sender, EventArgs e)
{
var _ip = String.IsNullOrEmpty(Request.ServerVariables["HTTP_X_FORWARDED_FOR"]) ? Request.ServerVariables["REMOTE_ADDR"] : Request.ServerVariables["HTTP_X_FORWARDED_FOR"];

HTTPHelper.UserHostAddress = _ip;
}

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 12/19/2012 10:18:16 AM
   
RE:On-line Marketing: Geolocation
Hello,

Thank you very much for this update! My colleague Vita Janecek has already informed me that he was trying to find a solution for your issue. I hope that this code will also help a few more developers. You're awesome. Thanks again for sharing :)

Best regards,
Martin Danko