Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Geolocation test
<script runat="server">
private void PrintInfo() {
Response.Write("Country " + Sitecore.Analytics.Tracker.Current.Interaction.GeoData.Country);
Response.Write("<br/>");
Response.Write("AreaCode " + Sitecore.Analytics.Tracker.Current.Interaction.GeoData.AreaCode);
Response.Write("<br/>");
Response.Write("City " + Sitecore.Analytics.Tracker.Current.Interaction.GeoData.City);
Response.Write("<br/>");
Response.Write("XFWFOR " + HttpContext.Current.Request.Headers["X-Forwarded-For"]);
Response.Write("<br/>");
NameValueCollection headers = HttpContext.Current.Request.Headers;
for (int i = 0; i < headers.Count; i++)
{
string key = headers.GetKey(i);
string value = headers.Get(i);
Response.Write(key + " = " + value + "<br/>");
}
}
</script>
<ul>
<%
PrintInfo();
%>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.