gjshah7254
3/24/2014 - 1:39 AM

Detect Country or IP address of a User.html




CMS.WebAnalytics.GeoLocation myLocation = CMS.WebAnalytics.GeoIPHelper.GetCurrentGeoLocation();
string myCountry = myLocation.CountryName.ToString();

if (myCountry == "New Zealand")
{
 
}


 Response.Write(AnalyticsContext.CurrentGeoLocation.CountryName);

       Response.Write("{%ip%}".ResolveMacro());
       Response.Write(OnlineMarketingContext.CurrentContact.ContactCountryID);

       

//You can test on the below website from different countries or IP addresses:
//http://boomproxy.com
//http://www.hidemyass.com
//http://newipnow.com