Last active
January 29, 2020 17:17
-
-
Save klpatil/d4c5d242b715ac8c6213366e85be585c to your computer and use it in GitHub Desktop.
Geolocation test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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/>"); | |
} | |
foreach (string var in Request.ServerVariables) | |
{ | |
Response.Write(var + " " + Request[var] + "<br>"); | |
} | |
} | |
</script> | |
<ul> | |
<% | |
PrintInfo(); | |
%> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment