Monday 28 November 2016

Chrome Extension for Testing GeoIP

Recently I've been working on a project that used GeoIP.  In particular the site has a location finder map, that uses your location as a starting point.  

Not being able to test different locations was an issue for me.  And then we were asked to develop some personalization that used the State/Region value obtained via GeoIP! 

How do you easily test for different scenarios, and more importantly how would the end user do effective UAT?

Whilst doing some research into the issue I came across the following chrome browser plug-in. It solves the problem by allowing you to override the appropriate browser data that contains the IP address value and trick the GeoIP detection into thinking you are somewhere you are not.  In effect spoofing an IP Address.

Here's a link to the tool:

https://chrome.google.com/webstore/detail/sitecore-analytics-testin/pecalkbdlhhhcoenmcjnmhgnncnkdgak?utm_source=chrome-app-launcher-info-dialog

Once installed you will see a Sitecore logo top-right.  Click on the logo and under GeoIP you will see the name of the selected profile - Default is the one set up for you on install.



Click on drop-down arrow to the right of the Default text, and select Manage Profiles


Here you can then add new profiles.  In the text boxes give it a name and enter the appropriate external IP address and click the Add Profile button:





Now open a new tab and navigate to your Sitecore site, click on the Sitecore logo and select the profile you want to use and then select New Contact. The page will refresh and your IP address will be changed to the selected one.

N.B. One point to note is that in order for this to work, you will need to update the Analytics.ForwardedRequestHttpHeader value in
Sitecore.Analytics.Tracking.config file.  You should use whatever value you have configured in the GeoIP settings in the tool:






Typical choices are X-Forwarded-For or X-Real-IP.

Note that the instructions supplied in the GeoIP settings section are wrong for Sitecore version 8.1 the setting is not in Sitecore.Analytics.config file.